wacli 是一个 WhatsApp 命令行工具,仅在用户明确要求你联系第三方或同步、搜索 WhatsApp 历史记录时使用;普通用户聊天由 OpenClaw 自动路由,不应调用此工具。
用途:向他人发送 WhatsApp 消息(文本、文件、群组),以及搜索与同步聊天历史。
主要能力与用法: 认证与同步:wacli auth(扫码登录与初始同步)、wacli sync --follow(持续同步)、wacli doctor(诊断)。 查找聊天与消息:wacli chats list --limit 20 --query "name or number";wacli messages search "query" --limit 20 --chat <jid>;wacli messages search "invoice" --after 2025-01-01 --before 2025-12-31。 历史回填:wacli history backfill --chat <jid> --requests 2 --count 50。 发送:文本 wacli send text --to "+14155551212" --message "Hello! Are you free at 3pm?";群组 wacli send text --to "1234567890-123456789@g.us" --message "Running 5 min late.";文件 wacli send file --to "+14155551212" --file /path/agenda.pdf --caption "Agenda"。
注意事项:数据默认存放在 ~/.wacli(可用 --store 覆盖);使用 --json 获取便于解析的输出;回填需要手机在线且结果尽力而为。JID 格式:直接聊天为 <number>@s.whatsapp.net,群组为 <id>@g.us(可用 wacli chats list 查找)。
安全要求:发送前需有明确的收件人和消息内容,并确认收件人与消息;若有歧义,应先提出澄清问题。