yowsup-cli - command line tool that acts as WhatsApp client
Contents
Commands
Available commands are registration, demos and version.
’registration' is used to register a mobile number to WhatsApp network.
’demos' is the proper command to regular use as a WhatsApp client.
’version' shows the yowsup-cliversion.
Configuration File
A configuration file, known as login credentials, can be used to gather some basic information that
useful to register or login. This configuration file will be called by '-c' option.
WhatsApp protocol is basically a modified version of XMPP. It uses JID and password for login. The JID is
the phone number registered with, which is a combination of the country code and the phone number. To
login will be needed a password. These info can be saved in a text file, in the following format:
cc=55
phone=556101234567
password=NDkxNTIyNTI1NjAyMkBzLndoYXRzYXBwLm5ldA==
The line 'cc=' must be filled with the country code.
The 'phone=' field will be composed by 'country code' + 'area code' + 'phone number'. In the current
example was used 55 (country = Brazil) + 61 (area code = Brasilia) + 01234567 (phone number). The country
code must be provided without '+' or '00' leading.
Finally, the 'password=' field has the login password. This password will be gotten when you register the
phone number using yowsup-cli. See the REGISTERING A NUMBER section. If you are registering a number, you
can leave this field blank.
For security reasons, is recommended set a permission '600' to configuration file and make it hidden.
More details about the configuration file can be viewed using this command:
$ yowsup-cli registration --help-config
Demos Options
Optional arguments
-h,--help
Show this help message and exit.
-v,--version
Print version info and exit.
-d,--debug
Show debug messages.
--help-config
Print a config file sample.
Configuration options
-lphone:b64password,--loginphone:b64password
WhatsApp login credentials, in the format phonenumber:password, where password is base64
encoded.
-cCONFIG,--configCONFIG
Path to config file containing authentication info. For more info about the config format,
use --help-config.
-E{android,s40},--env{android,s40}
Set the environment that yowsup must simulate. Default: android.
-M,--unmoxie
Disable support for WhatsApp E2E encryption.
Text interface demo
-y,--yowsup
Start the Yowsup text interface client (interactive mode). Note that in this mode two
clients or a group can talk in chat mode, send images, etc.
Echo client demo
-e,--echo
Start the Yowsup Echo client.
Send client demo
-sphonemessage,--sendphonemessage
Send a message to specified phone number, wait for server receipt and exit.
Sync contacts-Scontacts,--synccontacts
Sync (check valid) WhatsApp contacts.
Description
yowsup-cli is a command line program, based in python-yowsup library, that allows one to login and use
the WhatsApp service, providing all capabilities of an official WhatsApp client, as encryption of
messages.
Name
yowsup-cli - command line tool that acts as WhatsApp client
Registering A Number
WhatsApp registration involves 2 steps. First you need to request a registrationcode. After this, you
resume the registration with code that you got. In both cases, you can or not use a configuration file
(see the above section in this manual page).
An example not using a configuration file:
yowsup-cli registration --requestcode sms --phone 556101234567 --cc 55 --mcc 123 --mnc 456
yowsup-cli registration --register 123-456 --phone 556101234567 --cc 55
Now, using a configuration file:
yowsup-cli registration --requestcode sms --mcc 123 --mnc 456 -c /home/user/.yowsuprc
yowsup-cli registration --register 123-456 -c /home/user/.yowsuprc
The first command (the '--requestcode' action) will show something similar to:
status: sent
retry_after: 10805
length: 6
method: sms
After this, the code will then be delivered to your mobile phone number via your preferred method
(SMS/voice). Once you have obtained the code, you proceed with the second step, which is to send that
code using the '--register' argument. This example will consider the received code as being 123-456:
yowsup-cli registration --register 123-456 -c /home/user/.yowsuprc
After the last command, you will see something similar to:
status: ok
kind: free
pw: 1coGO6bwjT8Uukw9qa8v3ql2KXM=
price: US$0.99
price_expiration: 1407002374
currency: USD
cost: 0.99
expiration: 1435773701
login: 556101234567
type: new
If you successfully register, WhatsApp will generate a password for your which will be displayed in the
command output (see the 'pw:' line). If you want to use a config file, you MUST MANUALLY store this
password in this config file. See an example:
cc=55
phone=556101234567
password=1coGO6bwjT8Uukw9qa8v3ql2KXM=
Registration Options
Optional arguments
-h,--help
Show this help message and exit.
-v,--version
Print version info and exit.
-d,--debug
Show debug messages.
--help-config
Print a config file sample.
Configuration options
-cCONFIG,--configCONFIG
Path to config file. If this is not set then you must set at least --phone and --cc
arguments. The config file is optional. Other configuration arguments have higher priority
if given, and will override those specified in the config file.
-mMCC,--mccMCCMCC (Mobile Country Code). Check your MCC at a specific list (see below).
-nMNC,--mncMNCMNC (Mobile Network Code). Check your MNC at a specific list (see below).
-pPHONE,--phonePHONE
The full phone number including the country code defined in 'cc', without preceding '+' or
'00'.
-CCC,--ccCCCC (Country Code).
Modes to register
-r(sms|voice),--requestcode(sms|voice)
Request the digit registrationcode from WhatsApp.
-Rcode,--registercode
Register account on WhatsApp using a code previously received.
Specific lists for MCC and MNC
• http://www.mcc-mnc.com
• http://en.wikipedia.org/wiki/Mobile_country_code
Specific lists for country codes
• https://countrycode.org
• http://mcclist.com/country-calling-codes.asp
• http://www.ipipi.com/help/telephone-country-codes.htmSending Messages
Sendasimplemessageto+005511190102030(usingaconfigfile):
$ yowsup-clidemos-c /path/.config_file -s 5511190102030 "Testing WhatsApp..."
Sendasimplemessageto+005511190102030(withoutaconfigfile),from556101234567:
$ yowsup-clidemos-l 556101234567:1coGO6bwjT8Uukw9qa8v3ql2KXM= -s 5511190102030 "Testing
WhatsApp..."
Starttheinteractivemode(usingaconfigfile)
$ yowsup-clidemos-c /path/.config_file -y
Start a chat with 5511190102030, after connected in interactive mode (see the last command):
/L
/message send 5511190102030 "Testing WhatsApp..."
Send a picture to 5511190102030, after connected in interactive mode:
/L
/image send 5511190102030 /home/user/picture.jpg
To see all commands available in interactive mode:
/help
Synopsis
yowsup-cli [COMMANDS] [OPTIONS]
yowsup-cliregistration [-h] [-v] [-d] [--help-config] [-cCONFIG] [-mMCC] [-nMNC] [-pPHONE] [-CCC] [-r (sms|voice) | -Rcode]
yowsup-clidemos [-h] [-v] [-d] [--help-config] [-lphone:b64password | -cCONFIG] [-E {android,s40}], [-M] [-y] [-e] [-sphonemessage] [-Scontacts]
yowsup-cliversion