用途:wacli 是 WhatsApp 的命令行工具,仅在用户明确要求你向他人发送 WhatsApp 消息,或要求同步/搜索 WhatsApp 历史记录时使用。普通用户聊天不要使用它,Clawdbot 会自动路由 WhatsApp 会话;若用户正通过 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 查找)。