WhatsApp CLI

Send WhatsApp messages, sync/search history via the wacli CLI. For messaging third parties, not normal user chats.

wacli is a Go-based CLI tool that lets your OpenClaw agent send WhatsApp messages to other people, search chat history, and sync conversations — all from the command line. It's built on the whatsmeow library (the same Go WhatsApp Web API that powers many WhatsApp bots) and wraps it into a clean, agent-friendly interface. The key distinction: wacli is for messaging *other people* on WhatsApp, not for your normal chats with the AI. If you're already chatting with OpenClaw via WhatsApp, those messages route automatically through the WhatsApp channel. wacli is the tool you reach for when you say 'message John about the meeting' or 'search my WhatsApp for that invoice.' Authentication uses QR code linking — just like adding a new device to your WhatsApp account. Once linked, wacli maintains a persistent session in ~/.wacli. It supports text messages, file attachments with captions, group messages, history backfill, and full-text search across your synced conversations. The safety model is deliberate: the skill requires explicit recipient and message text, and confirms before sending. This prevents your AI from accidentally messaging the wrong person. Built by Peter Steinberger (steipete), the creator of OpenClaw, wacli is a first-party tool that integrates seamlessly with the agent's workflow.

Tags: whatsapp, messaging, chat, communication

Category: Messaging

Use Cases

  • Send meeting reminders or follow-ups to contacts via WhatsApp
  • Search WhatsApp history for specific conversations, invoices, or shared files
  • Automated check-ins — AI messages a contact on schedule
  • Forward important information from email/calendar to WhatsApp contacts
  • Sync and archive WhatsApp conversations for record-keeping

Tips

  • Always use `wacli chats list --query 'name'` to find the correct JID before sending
  • Use `--json` flag when parsing output programmatically in scripts
  • Run `wacli sync --follow` in a tmux session for continuous background sync
  • Use `wacli doctor` to diagnose connection issues before debugging manually
  • For group messages, find the group JID first with `wacli chats list` — don't guess the format
  • Combine with cron for scheduled WhatsApp check-ins or reminders to contacts

Known Issues & Gotchas

  • wacli is NOT for your normal AI chats — those route through the WhatsApp channel automatically
  • QR code auth expires quickly — scan within 60 seconds or regenerate
  • WhatsApp may temporarily ban accounts that send too many messages too fast — respect rate limits
  • History backfill requires your phone to be online and connected; results are best-effort
  • Group JIDs look different from direct chats — use `wacli chats list` to find the right format
  • Session data in ~/.wacli must be kept secure — it's equivalent to a logged-in WhatsApp session

Alternatives

  • WhatsApp Business API
  • Baileys (Node.js)
  • OpenClaw WhatsApp Channel
  • Postiz Agent

Community Feedback

wacli: WhatsApp integration through CLI. I find this better than Telegram. Maybe a personal choice.

— LinkedIn

wacli: A Swiss-army CLI tool for agent automation that covers a wide range of utility tasks including WhatsApp messaging.

— DataCamp Blog

To run the OpenClaw WhatsApp Robot Skill, you'll need to install necessary runtime environments. The QR code linking process can be finicky on first setup.

— Tencent Cloud

The WhatsApp library (whatsmeow) was wrapped into wacli. It's the cleanest way to give your AI agent WhatsApp superpowers.

— Facebook

Configuration Examples

First-time authentication

# Link your WhatsApp account
wacli auth
# Scan the QR code with your phone
# WhatsApp > Settings > Linked Devices > Link a Device

Send a message to a contact

# Find the contact first
wacli chats list --limit 20 --query "John"

# Send a text message
wacli send text --to "+14155551212" --message "Hey, are we still on for 3pm?"

# Send a file with caption
wacli send file --to "+14155551212" --file ./report.pdf --caption "Q4 Report"

Search message history

# Search across all chats
wacli messages search "invoice" --limit 20

# Search within date range
wacli messages search "project update" --after 2025-01-01 --before 2025-12-31

Installation

brew install steipete/tap/wacli

Homepage: https://wacli.sh

Source: bundled