Read when: listing, searching, exporting, showing, or inspecting local message context.
Most wacli messages commands read from the local store. messages edit and messages delete are remote WhatsApp mutations and require an authenticated, writable store.
wacli messages list [--chat JID] [--sender JID] [--from-me|--from-them] [--asc] [--limit N] [--after DATE] [--before DATE] [--forwarded] [--starred]
wacli messages search <query> [--chat JID] [--from JID] [--has-media] [--type text|image|video|audio|document] [--forwarded] [--starred] [--limit N] [--after DATE] [--before DATE]
wacli messages starred [--chat JID] [--limit N] [--after DATE] [--before DATE] [--asc]
wacli messages export [--chat JID] [--limit N] [--after DATE] [--before DATE] [--output PATH]
wacli messages show --chat JID --id MSG_ID
wacli messages context --chat JID --id MSG_ID [--before N] [--after N]
wacli messages edit --chat JID --id MSG_ID --message TEXT [--post-send-wait 2s]
wacli messages delete --chat JID --id MSG_ID [--for-me] [--delete-media] [--post-send-wait 2s]- Uses SQLite FTS5 when the binary was built with
-tags sqlite_fts5. - Falls back to
LIKEif FTS5 is not available. --typeacceptstext,image,video,audio, ordocument.--starredrestricts list/search results to messages marked as starred by WhatsApp.- Time filters accept RFC3339 or
YYYY-MM-DD.
messages starredlists starred messages ordered by star time when app-state events provide it; history-imported rows fall back to message time.--afterand--beforeonmessages starredfilter by that stored star time.- Starred state is imported from history sync and app-state star/unstar events.
messages exportwrites a JSON export envelope with messages ordered oldest first.- Use
--chatto export one chat, or omit it to export recent messages across chats. - Use
--afterand--beforeto bound the exported time window. - Use
--outputto write the JSON export to a file.
messages editupdates one of your own recent sent text messages. WhatsApp only accepts edits inside its current edit window.messages deleterevokes one of your own sent messages for everyone.messages delete --for-meremoves a stored message only for your WhatsApp account using WhatsApp'sdeleteMessageForMeapp-state patch; it can target messages sent by you or by others.--delete-mediais only valid with--for-me.- Both commands look up the target in the local store first and honor
--read-only/WACLI_READONLY. Delete-for-everyone and edit require a message sent by you. - Deleted messages and WhatsApp delete-for-me events are kept as local tombstones for direct
messages show, but are hidden from normal list/search/starred/export results.
When a phone-number chat JID maps to a stored @lid row, list/search/show/context include the mapped rows so historical LID splits do not hide messages.
wacli messages list --chat [email protected] --asc
wacli messages list --from-me --limit 20
wacli messages starred --limit 20
wacli messages search "invoice" --has-media --type document
wacli messages search "invoice" --starred
wacli messages export --chat [email protected] --after 2024-01-01 --before 2024-02-01 --output messages.json
wacli messages show --chat [email protected] --id ABC123
wacli messages context --chat [email protected] --id ABC123 --before 3 --after 3
wacli messages edit --chat [email protected] --id ABC123 --message "updated text"
wacli messages delete --chat [email protected] --id ABC123
wacli messages delete --chat [email protected] --id ABC123 --for-me