wacli 是做什么的?
仅在用户明确要求向其他人发送 WhatsApp 消息,或要求同步/搜索 WhatsApp 历史时,才使用 wacli。
不要在常规用户聊天中使用 wacli;OpenClaw 会自动路由 WhatsApp 对话。
如果用户正在 WhatsApp 上与您聊天,除非他们要求您联系第三方,否则不应使用此工具。
安全
- 需要显式的接收者 + 消息文本。
- 发送前确认接收者 + 消息。
- 如有任何歧义,请提出澄清问题。
认证与同步
wacli auth(QR 码登录 + 初始同步)wacli sync --follow(持续同步)wacli doctor
查找聊天与消息
wacli chats list --limit 20 --query "名称或号码"wacli messages search "查询" --limit 20 --chat <jid>wacli messages search "发票" --after 2025-01-01 --before 2025-12-31
历史回填
wacli history backfill --chat <jid> --requests 2 --count 50
发送
- 文本:
wacli send text --to "+14155551212" --message "你好!下午3点有空吗?" - 群组:
wacli send text --to "[email protected]" --message "晚到5分钟。" - 文件:
wacli send file --to "+14155551212" --file /path/agenda.pdf --caption "议程"
备注
- 存储目录:
~/.wacli(通过--store覆盖)。 - 解析时使用
--json以获得机器可读的输出。 - 回填需要您的手机在线;结果将尽最大努力提供。
- 常规用户聊天不需要 WhatsApp CLI;它用于给其他人发消息。
- JID:直接聊天格式为
<号码>@s.whatsapp.net;群组格式为<ID>@g.us(使用wacli chats list查找)。