wu
WhatsApp CLI tool — like gh is to GitHub, wu is to WhatsApp.
Built on @whiskeysockets/baileys.
Install
npm install -g @ibrahimwithi/wu-cli
Requires Node.js 20+.
Quick Start
# Authenticate (scan QR code)
wu login
# Or use pairing code instead
wu login --code 15551234567
# Start collecting messages
wu listen
# Search messages
wu messages search "meeting tomorrow"
# Send a message
wu messages send 1234567890@s.whatsapp.net "Hello!"
# List your groups
wu groups list --live
By default, wu operates in opt-in mode — no messages are collected until you allow specific chats:
# Allow all group messages (read-only)
wu config allow '*@g.us' --mode read
# Allow full access to a specific chat
wu config allow 1234567890@s.whatsapp.net
# Start collecting
wu listen
Commands
Authentication
| Command | Description |
|---|
wu login | Authenticate with WhatsApp via QR code |
wu login --code <phone> | Authenticate via pairing code |
wu logout | Clear session |
wu status | Show connection status and account info |
Messages
| Command | Description |
|---|
wu messages list <jid> | List messages in a chat |
wu messages search <query> | Full-text search messages (FTS5 ranked) |
wu messages send <jid> [text] | Send text, media, or poll |
wu messages react <jid> <id> <emoji> | React to a message |
wu messages delete <jid> <id> | Delete a message for everyone |
wu messages export <jid> | Export messages to a file (jsonl/json/markdown/csv) |
# Send with media
wu messages send 1234567890@s.whatsapp.net --media photo.jpg --caption "Check this out"
# Create a poll
wu messages send 120363XXX@g.us --poll "Lunch?" --options "Pizza,Sushi,Tacos"
# Reply to a message
wu messages send 120363XXX@g.us "Agreed" --reply-to BAE5ABC123
# Search within a specific chat
wu messages search "budget" --chat 120363XXX@g.us --limit 20
# Download all undownloaded media in a chat
wu media download-batch 120363XXX@g.us --limit 50 --concurrency 4
# Export all messages since a timestamp to a file
wu messages export 120363XXX@g.us --after 1772548621 --format jsonl --output data/export.jsonl
# Export as readable markdown
wu messages export 120363XXX@g.us --format markdown --output data/chat.md
Chats & Contacts
| Command | Description |
|---|
wu chats list | List all chats |
wu chats search <query> | Search chats by name |
wu contacts list | List all contacts |
wu contacts search <query> | Search contacts by name or phone |
wu contacts info <jid> | Show contact details |
Groups
| Command | Description |
|---|
wu groups list | List groups (cached) |
wu groups list --live | Fetch groups from WhatsApp |
wu groups info <jid> | Show group details and participants |
wu groups create <name> [jids...] | Create a new group |
wu groups invite <jid> | Get invite link |
wu groups leave <jid> | Leave a group |
wu groups rename <jid> <name> | Rename a group |
wu groups join <code-or-url> | Join a group by invite code or URL |
wu groups participants <jid> | List group participants |
Media
| Command | Description |
|---|
wu media download <msg-id> | Download media from a message |
wu media download-batch <jid> | Download undownloaded media in parallel |
wu media send <jid> <path> | Send a media file |
History
| Command | Description |
|---|
wu history backfill <jid> | Request older messages from WhatsApp |
# Backfill 50 older messages for a group
wu history backfill 120363XXX@g.us --count 50
# With JSON output
wu history backfill 120363XXX@g.us --count 20 --json
Daemon
# Run as a foreground daemon — collects messages continuously
wu daemon
# Install as a systemd service (Linux)
wu daemon install
# Remove systemd service
wu daemon uninstall
# View daemon logs
wu daemon logs
The daemon auto-reconnects on connection drops, logs health every 5 minutes, and stores all messages to SQLite.
Remote Sync
Run the daemon on a VPS collecting messages 24/7, query from your local machine. All communication over SSH — no exposed ports, no extra auth.
# --- On the VPS ---
npm i -g @ibrahimwithi/wu-cli
wu login
wu daemon install
# --- On your local machine ---
# Add the remote
wu remote add vps user@your-vps-ip
# Push your constraints to the server
wu remote setup vps --push
# Pull the database
wu sync pull
# Continuous sync every 30s
wu sync pull --watch --interval 30
# Install as a systemd timer (Linux)
wu sync install --interval 60