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 [email protected] "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 [email protected]
# 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 [email protected] --media photo.jpg --caption "Check this out"
# Create a poll
wu messages send [email protected] --poll "Lunch?" --options "Pizza,Sushi,Tacos"
# Reply to a message
wu messages send [email protected] "Agreed" --reply-to BAE5ABC123
# Search within a specific chat
wu messages search "budget" --chat [email protected] --limit 20
# Download all undownloaded media in a chat
wu media download-batch [email protected] --limit 50 --concurrency 4
# Export all messages since a timestamp to a file
wu messages export [email protected] --after 1772548621 --format jsonl --output data/export.jsonl
# Export as readable markdown
wu messages export [email protected] --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 with community tree and constraint status |
wu groups list --live | Fetch from WhatsApp and refresh community linkage |
wu groups list --allowed-only | Skip groups whose constraint is none |
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 |
By default wu groups list shows every group you're in (jid + name + community shape) so you can see what's there before opting in. Description, full participant list, and messages stay constraint-gated. Set whatsapp.group_discovery: false in the config to revert to the old behavior where group metadata is only stored when the constraint allows.
Communities
| Command | Description |
|---|
wu communities list | List WhatsApp Communities (parent groups) |
wu communities list --with-subgroups | Include linked subgroups under each parent |
Direct messages (DMs)
| Command | Description |
|---|
wu dms list | List 1:1 chats you've opted into |
wu dms list --all | Include DMs blocked by constraints |
wu dms search <query> | Search 1:1 chats by name |
DM JIDs contain the contact's phone number, so they're always constraint-gated regardless of group_discovery.
Media
| Command | Description |
|---|
wu media download <msg-id> | Download media from a message |
wu media download-batch [jid] | Download undownloaded media in parallel (--ids a,b,c for specific messages) |
wu media send <jid> <path> | Send a media file |
wu media transcribe <msg-id> | Transcribe a voice/audio message to text |
wu media ocr <msg-id> | Extract text from an image message |
wu media prune | Delete downloaded media files (--older-than 30d, --chat, --dry-run) |
Transcripts and OCR text are stored on the message and indexed for wu messages search.
Enrichment