[BREAKGLASS] WhatsApp CLI https://wacli.sh/
Go to file
2026-05-07 04:20:45 +01:00
.agents/skills/wacli docs: add wacli agent skill 2026-05-07 01:22:13 +01:00
.github docs: add hosted docs command and pages site 2026-05-05 10:41:23 +01:00
cmd/wacli chore: start 0.8.0 development 2026-05-06 23:50:49 +01:00
docs feat: improve interactive sync status 2026-05-07 00:18:13 +01:00
internal feat: improve interactive sync status 2026-05-07 00:18:13 +01:00
scripts docs: highlight docs site code blocks 2026-05-07 04:20:45 +01:00
.gitignore Add pnpm scripts and run via CI 2025-12-12 14:59:48 +00:00
.goreleaser-linux-windows.yaml ci: add multi-os release workflow 2026-01-23 00:49:33 +00:00
.goreleaser.yaml ci: add multi-os release workflow 2026-01-23 00:49:33 +00:00
AGENTS.md docs: add AGENTS.md for AI agent guidance (#190) 2026-04-24 21:45:40 -07:00
CHANGELOG.md feat: improve interactive sync status 2026-05-07 00:18:13 +01:00
go.mod feat: add named accounts 2026-05-06 23:28:01 +01:00
go.sum feat: add named accounts 2026-05-06 23:28:01 +01:00
LICENSE chore: fix copyright header 2026-04-27 11:27:01 +01:00
package.json chore: update dependencies 2026-05-06 06:22:12 +01:00
pnpm-lock.yaml build: update pnpm metadata 2026-04-27 13:33:46 +01:00
README.md feat: add named accounts 2026-05-06 23:28:01 +01:00

🗃️ wacli — WhatsApp CLI: sync, search, send

A scriptable WhatsApp client built on whatsmeow. Pairs as a linked WhatsApp Web device, mirrors your messages into a local SQLite store, and gives you offline search, sending, and chat/group/contact management from the command line.

Third-party tool. Uses the WhatsApp Web protocol via whatsmeow. Not affiliated with WhatsApp.

Full documentation: https://wacli.sh

Features

  • Auth + sync — QR pairing, one-shot or follow-mode sync, optional media downloads, optional signed webhook fan-out.
  • Offline message store — SQLite with FTS5 search (LIKE fallback), filterable by chat, sender, direction, time, and media type.
  • Sending — text with mentions/replies/link-previews, files (image/video/audio/document, ≤100 MiB), stickers, voice notes, reactions; rapid-send guardrails and retry-receipt grace.
  • History backfill — best-effort per-chat requests to your primary device for older messages.
  • Contacts / chats / groups / channels — search, alias, tag, archive, pin, mute, mark-read, rename, prune, manage participants and invite links, send to channels.
  • Diagnostics + safetydoctor, read-only mode, store locks with owner reporting, panic recovery, bounded media queue, owner-only DB perms.
  • Scriptable--json everywhere, --events NDJSON lifecycle stream, deterministic exit codes.

Install

brew install steipete/tap/wacli

If a Linux install reports Binary was compiled with 'CGO_ENABLED=0', run brew update && brew reinstall steipete/tap/wacli.

Build from source

wacli uses go-sqlite3, so cgo + a C compiler are required.

  • macOS: Xcode Command Line Tools.
  • Debian/Ubuntu: sudo apt install build-essential.
CGO_ENABLED=1 go build -tags sqlite_fts5 -o ./dist/wacli ./cmd/wacli
./dist/wacli --help

Quick start

# 1. Pair (shows QR), then bootstrap sync
wacli auth

# 2. Keep syncing in the background (no QR; needs prior auth)
wacli sync --follow

# 3. Search
wacli messages search "meeting"

# 4. Send
wacli send text --to 1234567890 --message "hello"
wacli send file --to mom --file ./pic.jpg --caption "hi"

# 5. Diagnostics
wacli doctor

Recipients accept a JID, phone number (E.164 or formatted), channel JID, or a synced contact/group/chat name. Ambiguous names prompt in a TTY; pass --pick N in scripts.

More recipes — replies, mentions, stickers, voice, reactions, channels, history backfill, chat management — live in the docs.

Documentation

Area Pages
Setup overview · auth · accounts · sync · doctor
Messaging messages · send · media · presence
Address book contacts · chats · groups · channels
History history coverage / fill / backfill
Local store store · companion integrations
Misc profile · version · completion · release

Configuration

Default store: ~/.local/state/wacli on Linux, ~/.wacli elsewhere. Existing ~/.wacli directories on Linux keep working. Use wacli accounts add NAME and --account NAME for first-class multi-account stores.

Global flags: --store DIR, --account NAME, --json, --events, --full, --timeout DUR, --lock-wait DUR, --read-only.

Environment overrides:

Variable Effect
WACLI_STORE_DIR Default store directory.
WACLI_READONLY 1/true/yes/on enables read-only mode.
WACLI_DEVICE_LABEL Linked-device label shown in WhatsApp. Defaults to wacli - <OS> (<host>).
WACLI_DEVICE_PLATFORM Linked-device platform. Defaults to DESKTOP; invalid values fall back to CHROME.
WACLI_SYNC_MAX_MESSAGES Stop sync once total local messages exceed this count.
WACLI_SYNC_MAX_DB_SIZE Stop sync once wacli.db + sidecars reach a size like 500MB or 2GB.

Backfilling older history

wacli sync only stores what WhatsApp Web sends opportunistically. To fetch older messages, wacli issues on-demand history requests to your primary device (your phone), which must be online.

  • Best-effort: WhatsApp may not return full history.
  • One request anchors on the oldest locally stored message in that chat — run sync first.
  • Recommended --count 50 per request (max 500). Max --requests 100 per run.
  • history coverage shows which chats are eligible. history fill --dry-run plans without connecting.
wacli history coverage --include-blocked
wacli history fill --dry-run --kind group --limit 20
wacli history backfill --chat 1234567890@s.whatsapp.net --requests 10 --count 50

Loop over every known chat:

wacli --json chats list --limit 100000 \
  | jq -r '.data[].JID' \
  | while read -r jid; do
      wacli history backfill --chat "$jid" --requests 3 --count 50
    done

Credits

Heavily inspired by whatsapp-cli by Vicente Reig.

Maintainers

License

See LICENSE.