wacli
Use wacli only when the user explicitly asks you to message someone else on WhatsApp or when they ask to sync/search WhatsApp history.
Do NOT use wacli for normal user chats; OpenClaw routes WhatsApp conversations automatically.
If the user is chatting with you on WhatsApp, you should not reach for this tool unless they ask you to contact a third party.
Safety
- - Require explicit recipient + message text.
- Confirm recipient + message before sending.
- If anything is ambiguous, ask a clarifying question.
Auth + sync
- -
wacli auth (QR login + initial sync) - INLINECODE3 (continuous sync)
- INLINECODE4
Find chats + messages
- - INLINECODE5
- INLINECODE6
- INLINECODE7
History backfill
Send
- - Text: INLINECODE9
- Group: INLINECODE10
- File: INLINECODE11
Notes
- - Store dir:
~/.wacli (override with --store). - Use
--json for machine-readable output when parsing. - Backfill requires your phone online; results are best-effort.
- WhatsApp CLI is not needed for routine user chats; it’s for messaging other people.
- JIDs: direct chats look like
<number>@s.whatsapp.net; groups look like <id>@g.us (use wacli chats list to find).
wacli
仅在用户明确要求您通过WhatsApp向他人发送消息,或要求同步/搜索WhatsApp历史记录时,才使用wacli。
请勿将wacli用于普通用户聊天;OpenClaw会自动路由WhatsApp对话。
如果用户正在WhatsApp上与您聊天,除非他们要求您联系第三方,否则不应使用此工具。
安全
- - 需要明确的收件人+消息文本。
- 发送前确认收件人+消息。
- 如有任何歧义,请提出澄清性问题。
认证+同步
- - wacli auth(二维码登录+初始同步)
- wacli sync --follow(持续同步)
- wacli doctor
查找聊天+消息
- - wacli chats list --limit 20 --query 姓名或号码
- wacli messages search 查询内容 --limit 20 --chat
- wacli messages search 发票 --after 2025-01-01 --before 2025-12-31
历史记录回填
- - wacli history backfill --chat --requests 2 --count 50
发送
- - 文本:wacli send text --to +14155551212 --message 你好!下午3点有空吗?
- 群组:wacli send text --to 1234567890-123456789@g.us --message 晚到5分钟。
- 文件:wacli send file --to +14155551212 --file /path/agenda.pdf --caption 议程
备注
- - 存储目录:~/.wacli(可通过--store覆盖)。
- 解析时使用--json获取机器可读输出。
- 回填需要您的手机在线;结果尽力而为。
- 常规用户聊天无需使用WhatsApp CLI;它用于向其他人发送消息。
- JID:直接聊天格式为<号码>@s.whatsapp.net;群组格式为@g.us(可使用wacli chats list查找)。