Send messages and search history via wacli. Requires WhatsApp Web pairing (QR scan
on first use).
Prerequisites
# Install via npm
npm install -g wacli
# First-time setup: pair with WhatsApp Web
wacli auth
# Scan the QR code with WhatsApp on your phone
Commands
| Command | Description |
|---|---|
wacli send "<phone>" "<message>" |
Send a message (phone in international format) |
wacli send --group "<group name>" "<message>" |
Send to a group |
wacli sync |
Sync recent message history locally |
wacli history "<phone>" |
Show message history with a contact |
wacli history "<phone>" --limit 20 |
Show last N messages |
wacli search "<query>" |
Search all synced messages for a keyword |
wacli contacts |
List saved contacts |
Usage Examples
Send a message by phone number:
wacli send "+886912345678" "Hi, just checking in!"
Send to a group:
wacli send --group "Family" "Dinner at 7pm tonight."
Sync and search history:
wacli sync
wacli search "project deadline"
View conversation history:
wacli history "+886912345678" --limit 15
Rules
- Always check if CLI is installed first:
which wacli - If not installed, show the npm install command and stop
- If not authenticated, run
wacli authand instruct user to scan the QR code - Phone numbers must be in international format (e.g. +886..., +1...)
- Never send a message without confirming recipient and content with the user
- When showing history, default to last 10 messages; save longer history to workspace/ and summarize
- Confirm sends with a single line: "Message sent to "
- Do not log or store message content in memory files