← 返回命令列表

Linux command

wacli 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Authenticate

wacli auth

Search

wacli messages search "[keyword]"

Send a text message

wacli send text --to [phone_number] --message "[message]"

Send a file

wacli send file --to [phone_number] --file [path/to/file] --caption "[caption]"

List

wacli chats list

Run a continuous sync

wacli sync --follow

Request older messages

wacli history backfill --chat [chat_jid] --count [50]

说明

wacli is a command-line interface for WhatsApp built on the whatsmeow library. It provides best-effort local synchronization of message history, fast offline full-text search, message sending, and contact and group management, all from the terminal. Authentication is performed by scanning a QR code displayed in the terminal from your primary WhatsApp device. Once authenticated, wacli stores session data, messages, contacts, and media references in a local SQLite database at ~/.wacli by default. The sync command captures incoming messages continuously, while history backfill requests older messages from the primary device on demand. Search uses SQLite FTS5 for fast full-text queries with LIKE fallback, returning results with contextual snippets. All output defaults to human-readable format with --json available for scripting and automation.

参数

auth
Interactive login via QR code and initial data sync
sync
Non-interactive sync loop; requires prior authentication
sync --follow
Keep syncing continuously
messages search _query_
Search synced messages using FTS5 full-text search
messages list _--chat jid_ _--limit n_
List messages, optionally filtered by chat
history backfill --chat _jid_ _--count n_ _--requests n_
Fetch older messages from primary device
media download --chat _jid_ --id _msg_id_
Download media for a specific message
send text --to _recipient_ --message _text_
Send a text message to a contact or group
send file --to _recipient_ --file _path_ _--caption text_ _--filename name_
Send a file with optional caption and display name override
chats list
List all chats
groups list
List all groups
groups rename --jid _group_jid_ --name _new_name_
Rename a group
doctor
Run diagnostics on the local store
--store _DIR_
Override default store directory (default: ~/.wacli)
--json
Machine-readable JSON output

FAQ

What is the wacli command used for?

wacli is a command-line interface for WhatsApp built on the whatsmeow library. It provides best-effort local synchronization of message history, fast offline full-text search, message sending, and contact and group management, all from the terminal. Authentication is performed by scanning a QR code displayed in the terminal from your primary WhatsApp device. Once authenticated, wacli stores session data, messages, contacts, and media references in a local SQLite database at ~/.wacli by default. The sync command captures incoming messages continuously, while history backfill requests older messages from the primary device on demand. Search uses SQLite FTS5 for fast full-text queries with LIKE fallback, returning results with contextual snippets. All output defaults to human-readable format with --json available for scripting and automation.

How do I run a basic wacli example?

Run `wacli auth` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does auth do in wacli?

Interactive login via QR code and initial data sync