LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

wacli-messages-search

Search WhatsApp message history using full-text search

TLDR

Search all messages for a keyword
$ wacli messages search "meeting notes" --json
copy
Search within a specific chat
$ wacli messages search "project" --chat 491234567890@s.whatsapp.net --json
copy
Search messages from a sender
$ wacli messages search "report" --from 491234567890@s.whatsapp.net --json
copy
Search by message type (image, video, etc.)
$ wacli messages search "" --type image --json
copy
Search documents that have media
$ wacli messages search "invoice" --has-media --type document --json
copy
Limit and filter by date
$ wacli messages search "budget" --chat 491234567890@s.whatsapp.net --after 2026-01-01 --limit 5 --json
copy

SYNOPSIS

wacli messages search query [--chat jid] [--from jid] [--has-media] [--type type] [--forwarded] [--starred] [--limit n] [--after date] [--before date] [--json] [--store dir]

DESCRIPTION

wacli messages search performs a full-text search over the locally synced message bodies. It uses SQLite FTS5 when the binary was built with `-tags sqlite_fts5`, and falls back to `LIKE` otherwise. Optional filters cover chat, sender, date range, media, type, and starred/forwarded flags.Search works completely offline once the store has been synced. Status broadcasts are not included.Default store path is `~/.local/state/wacli` on Linux and `~/.wacli` elsewhere.

PARAMETERS

query

Search terms. Supports simple terms; quote phrases as needed for the shell.
--chat jid
Limit search to one chat.
--from jid
Limit to messages from this sender.
--has-media
Only messages that include media.
--type type
Filter by content type: `text`, `image`, `video`, `audio`, or `document`.
--forwarded
Only forwarded messages.
--starred
Only starred messages.
--after, --before date
Date filters (RFC3339 or `YYYY-MM-DD`).
--limit n
Maximum results.
--json
JSON output.
--store dir
Override the store directory (cannot be combined with `--account`).

CAVEATS

Search only covers messages that have been synced into the local store. History is best-effort; use `wacli history backfill` for older messages.

SEE ALSO

RESOURCES

Copied to clipboard
Kai