Read and search your local WhatsApp messages from a terminal or coding agent.
wacli is a standalone Rust executable that reads the database maintained by the
native WhatsApp Mac app. It is local and read-only: no browser automation, cloud
service, separate QR pairing, Slack dependency, or helper runtime.
Download the latest release · Slack CLI
- Lists chats and their exact IDs.
- Reads messages in a selected chat, newest first.
- Searches message text, across chats or within one chat.
- Reports local message counts and the latest stored message time.
- Prints JSON for scripts and agents, with explicit pagination.
It does not send messages, mark conversations as read, download attachments, or connect directly to WhatsApp servers. Only messages already synced to this Mac are available. It cannot recover missing, deleted, or unsynced phone history. Media messages may have empty text; the CLI returns their stored message type. This is an unofficial local database reader, not the WhatsApp Business API.
Requires macOS 11 or newer and the native WhatsApp Mac app, signed in and synced. End users do not need Rust, Python, Node.js, Homebrew, or a database installation.
- Download
wacli-macos-arm64.tar.gzfor an Apple Silicon (M-series) Mac, orwacli-macos-x86_64.tar.gzfor Intel, from the release page. - Extract the archive, which contains the executable, README, and license.
- Run these commands in the extracted folder:
mkdir -p "$HOME/.local/bin"
install -m 755 ./wacli "$HOME/.local/bin/wacli"
export PATH="$HOME/.local/bin:$PATH"
wacli --version
wacli statusAdd export PATH="$HOME/.local/bin:$PATH" to ~/.zshrc once to keep the command
available in new terminals. Updating uses the same download/install steps.
Verify the archive with shasum -a 256 wacli-macos-arm64.tar.gz (or the Intel
filename) and compare with the release's SHA256SUMS before installing.
Downloads are ad-hoc signed, not Apple-notarized. If macOS blocks a verified
browser download, allow that binary in System Settings → Privacy & Security.
If it remains quarantined, xattr -d com.apple.quarantine "$HOME/.local/bin/wacli"
removes quarantine from that one file. Do not disable Gatekeeper globally.
Open WhatsApp Desktop and let it sync before running wacli status. No Slack
Keychain approval or additional WhatsApp login is needed for this reader.
If macOS denies database access, grant the invoking Terminal or agent application access under System Settings → Privacy & Security → Full Disk Access, then reopen it. Only change this permission when access is denied. Do not share your database or passwords with an agent to work around a local permission error.
The default source is:
~/Library/Group Containers/group.net.whatsapp.WhatsApp.shared/ChatStorage.sqlite
For a compatible alternate local database, pass --db /absolute/path/to/file.
The CLI fails if the file is missing; it never creates an empty database there.
wacli status
wacli chats
wacli chats 'Project group' --limit 20
wacli read 'EXACT_CHAT_ID_FROM_CHATS' --limit 50
wacli search 'meeting' --limit 20
wacli search 'meeting' --chat 'EXACT_CHAT_ID_FROM_CHATS' --limit 20
wacli --db /path/to/ChatStorage.sqlite statusUse the exact id from chats in read and --chat. Duplicate display names
cannot select the wrong conversation. chats matches a literal name or ID
substring. search matches literal text, not SQL wildcards or regular expressions;
% and _ are ordinary characters. Matching uses SQLite's ASCII case folding,
so Unicode case-insensitive and semantic search are not supported.
--limit accepts 1–500 (default 50). --offset starts at zero. Results include
has_more and next_offset; pass the latter to continue:
wacli read 'EXACT_CHAT_ID_FROM_CHATS' --limit 50 --offset 50Each query sees a consistent database snapshot, including committed WAL data. Pagination across separate runs uses offsets, so incoming messages can shift page boundaries. For an unchanging export, query a consistent local backup.
A synthetic message result looks like:
{
"source": "whatsapp-macos",
"order": "newest_first",
"items": [{
"local_id": 12,
"message_id": "example-message",
"chat_id": "example@g.us",
"chat_name": "Example group",
"timestamp": "2026-01-01T10:00:00Z",
"from_me": false,
"sender_id": "example-sender",
"sender_name": "Alex",
"text": "Meeting at noon",
"message_type": 0
}],
"has_more": false,
"next_offset": null
}Timestamps are UTC ISO 8601; missing and out-of-range sentinel dates become
null. message_type is WhatsApp's internal numeric code, not a stable public
enumeration. Successful output goes to stdout. Errors go to stderr with nonzero
exit status; argument errors use standard CLI help.
The executable makes no network requests and stores no additional message cache.
It opens the app database with SQLite read-only flags plus query_only, and
executes only fixed, parameterized read queries. Reading leaves message state
unchanged. Protect output as private data; never submit real conversations or
app database files in public issues or test fixtures.
The database schema is unofficial and can change with WhatsApp updates. Schema mismatches fail explicitly. Verified locally with WhatsApp for Mac 26.35.23; this does not guarantee support for every older or future version. Windows, Linux, WhatsApp Web, encrypted phone backups, sending, and attachment downloads are outside this version's scope.
Contributors need Rust 1.92+ and Xcode Command Line Tools. Download users do not.
cargo test --locked
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo build --locked --release
./target/release/wacli --help
./scripts/package.shTests use synthetic databases and cover live WAL reads, exact chat selection,
literal search, paging, timestamp sentinels, missing/schema-invalid files, and
unchanged database/WAL bytes. CI also builds Apple Silicon and Intel archives.
scripts/package.sh creates archives and SHA-256 checksums in dist/.
SQLite is bundled into the executable; only macOS system libraries are dynamic dependencies. The Rust Turso engine was considered, but its compatibility guide excludes mixed SQLite/Turso access from separate processes. WhatsApp owns and updates this live SQLite database, so the reader uses SQLite's compatible locking and WAL behavior. No Turso account, server, or SQLite installation is required.
- Database not found: install/sign into native WhatsApp, open it, and sync.
- Permission denied: check permissions for the app invoking the command.
- Old or missing messages: compare
latest_local_message_atwith WhatsApp; the CLI cannot force a server sync. - Chat not found: obtain its exact ID using
chats, not its display name. - Unsupported schema: include the CLI and WhatsApp versions in a bug report, plus the error text only. Do not attach private database files.
MIT, copyright Grail Computer. WhatsApp is a trademark of its owner. This project is independent and is not affiliated with or endorsed by WhatsApp or Meta.