Wacli – WhatsApp CLI: sync, search, send

Wacli is a powerful third-party WhatsApp CLI tool built on whatsmeow, enabling local message synchronization, fast offline search, and account management directly from the terminal.
Introduction to Wacli
In the world of developers and CLI enthusiasts, managing messaging apps directly from the terminal is an essential need. Wacli emerges as an optimal solution for WhatsApp users. Built on top of the whatsmeow library, Wacli focuses on local data synchronization, fast search, and message management without the need for a graphical user interface.
This is a third-party tool that utilizes the WhatsApp Web protocol via whatsmeow and is not officially affiliated with WhatsApp.
Core Features
Wacli is more than just a messaging app; it is designed to optimize the workflow of professional users:
- Local Synchronization: Supports best-effort local sync of message history and continuous capture.
- Fast Offline Search: Powered by SQLite FTS5, allowing users to search through message history instantly without an internet connection.
- Multimedia Messaging: Supports sending text and files with customizable display names.
- Contact & Group Management: Easily list groups, rename them, and manage participants.
- JSON Output Support: Allows data to be exported in machine-readable format for automation integration.
Installation Guide
Users can install Wacli through two primary methods:
-
Via Homebrew (macOS/Linux):
brew install steipete/tap/wacli -
Build from Go source:
go build -tags sqlite_fts5 -o ./dist/wacli ./cmd/wacli
The default storage directory is ~/.wacli, which can be overridden using the --store flag.
Basic Commands
Here are some common commands to get started with Wacli:
- Authentication: Displays a QR code for login.
wacli auth - Synchronization: Maintains connection and captures new messages.
wacli sync --follow - Search Messages:
wacli messages search "meeting" - Send Text Message:
wacli send text --to 1234567890 --message "hello" - Send File:
wacli send file --to 1234567890 --file ./pic.jpg --caption "hi"
History Backfill Mechanism
A notable feature of Wacli is its ability to fetch older message history (Backfill). However, users should keep several technical points in mind:
- Best-effort: History retrieval depends on WhatsApp servers and does not guarantee 100% recovery of old data.
- Primary Device Requirement: Your primary phone must be online to respond to history sync requests.
- How it works: Wacli uses the oldest locally stored message in a chat as an anchor to request previous messages.
Command to backfill history for a specific chat:
wacli history backfill --chat [JID] --requests 10 --count 50
Conclusion
Wacli is a powerful tool that brings maximum flexibility to WhatsApp users who want to control their data directly from the command line. With its robust search capabilities and smart sync mechanism, it is a must-have utility in any software engineer's toolkit.
Source: Hacker News













