whatsapp
Want to manage WhatsApp from terminal? whatsapp-cli is a standalone CLI built on WhatsApp Web multi-device protocol. Install via x-cmd for terminal WhatsApp management.
| Language | Go |
| Homepage | https://github.com/vicentereig/whatsapp-cli |
- Using docker module to automatically pull the base image and, on first execution, reconstruct it as a fully runnable software image as needed.
- For subsequent runs, the command quickly launches containers based on the pre-built image, achieving near-instant startup.
- All operations are executed inside the container, completely isolated from the host system, requiring no local dependencies—secure, clean, and leaving no traces.
- When a rebuild is required due to software version or dependency changes, the Docker image build cache is fully leveraged to maximize reuse of downloaded dependencies and build artifacts, significantly reducing rebuild time.
x docker alpine whatsapp-clixd alp whatsapp-clix docker ubuntu whatsapp-clixd ubu whatsapp-clix docker kali whatsapp-clixd kal whatsapp-clix docker debian whatsapp-clixd deb whatsapp-clix docker fedora whatsapp-clixd fed whatsapp-clix install whatsapp
| /go | sh
|
| darwin/brew | sh
|
WhatsApp CLI: Command-Line Interface Based on WhatsApp Web Multi-Device Protocol
WhatsApp CLI is a standalone command-line interface for WhatsApp built on the WhatsApp Web multi-device protocol. Every command returns structured JSON output, making it ideal for automation scripts, AI tool integration, and data analysis.
Key Features
| Feature | Description |
|---|---|
| Zero Dependencies | Single binary (21MB), no runtime required |
| JSON Output | All commands return structured JSON for easy parsing |
| Persistent Sessions | Authenticate once via QR code, auto-reconnect for ~20 days |
| Local Storage | SQLite database, no cloud dependencies |
| Full Messaging | Send, receive, search messages; manage contacts & chats |
| Group Support | Send/receive messages in group chats |
Installation
Homebrew (Recommended)
brew install vicentereig/tap/whatsapp-cliBuild from Source
go install github.com/vicentereig/whatsapp-cli@latestDownload Pre-built Binary
# Linux (x86_64)
curl -LO https://github.com/vicentereig/whatsapp-cli/releases/latest/download/whatsapp-cli-linux-amd64.tar.gz
tar -xzf whatsapp-cli-linux-amd64.tar.gz
sudo mv whatsapp-cli-linux-amd64 /usr/local/bin/whatsapp-cliQuick Start
1. First-Time Authentication
whatsapp-cli auth- QR code appears in terminal
- Open WhatsApp on phone → Settings → Linked Devices → Link a Device
- Scan the QR code
- Session saved to
./store/whatsapp.db
2. Sync Messages
# Run in background or separate terminal
whatsapp-cli sync
# Press Ctrl+C to stop syncing3. Basic Operations
# List chats
whatsapp-cli chats list --limit 10
# Search contacts
whatsapp-cli contacts search --query "John"
# Send message
whatsapp-cli send --to 1234567890 --message "Hello from CLI!"
# Search messages
whatsapp-cli messages search --query "meeting"Common Commands
| Command | Description |
|---|---|
auth | Authenticate via QR code |
sync | Sync messages (stay connected for real-time) |
chats list | List chat conversations |
contacts search | Search contacts |
send | Send message |
messages search | Search message history |
version | Show version |
AI Integration
Since all output is structured JSON, perfect for AI tool integration:
# Get recent chats and process with AI
whatsapp-cli chats list --limit 5 | jq '.data.chats[].name'
# Search specific messages and analyze
whatsapp-cli messages search --query "project" | jq '.data.messages[].text'Data Model
- Session Database:
./store/whatsapp.db- Stores authentication session - Messages Database:
./store/messages.db- Stores message history - Format: SQLite, queryable with standard SQL tools
Use Cases
- Automate WhatsApp message sending (e.g., CI/CD notifications)
- Bulk export and analyze chat history
- Integrate WhatsApp into AI workflows
- Build custom applications on top of WhatsApp
- Manage WhatsApp via command line without opening phone
Source:
Help us make these docs great!
All X-CMD docs are generated from command help and multiple data sources. See something that's wrong or unclear? Feel free to let us know through any of these ways~