WhatsApp, on the command line.

Every command returns JSON. Sync once to a local SQLite store, then search, send, and script against it.

Install

brew install vicentereig/tap/whatsapp-cli
Other install methods →
whatsapp-cli sync
$ whatsapp-cli sync
🚀 Starting WhatsApp sync...
✓ Connected to WhatsApp
💬 Synced 1234 messages...
Watch it live

See it work

Two terminals. One keeps the local store in sync. The other queries it.

Illustrative session over the local messages table. chat_backup_agent.py is a 40-line example script, not a whatsapp-cli subcommand — the store is plain SQLite, so it's yours to query.

What's in the box

CommandWhat it doesFlags
authPair with your phone via QR code.
syncMirror new messages into the local store. Runs until Ctrl+C.
messages listList stored messages, newest first.--chat --limit --page
messages searchFull-text search across stored messages.--query --limit --page
contacts searchSearch contacts by name or number.--query
chats listList synced chats by recent activity.--query --limit --page
sendSend a text message.--to --message
media downloadDownload a message's media attachment.--message-id --chat --output

Noticed elsewhere