///
The `wacli messages` commands allow you to interact with your locally synchronized WhatsApp message history. You can list, search, view individual messages, and inspect message context using various f
386 views
~386 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
The wacli messages commands allow you to interact with your locally synchronized WhatsApp message history. You can list, search, view individual messages, and inspect message context using various filters.
For general installation and setup, refer to the [Getting Started] guide.
wacli messages list)The list command retrieves messages from your local database. By default, it shows the 50 most recent messages.
--chat JID: Filter messages by a specific chat JID (e.g., [email protected] or [email protected]).--limit N: Limit the number of results (default: 50).--after TIME: Only include messages sent after the specified time. Time can be in RFC3339 format (e.g., 2024-01-01T15:00:00Z) or YYYY-MM-DD (e.g., 2024-01-01).--before TIME: Only include messages sent before the specified time. Time format is the same as --after.To see the 50 most recent messages across all chats:
Human-readable output:
TIME CHAT FROM ID TEXT
2024-03-27 10:30:05 Alice me 3A003310 Hello there!
2024-03-27 10:29:10 My Group [email protected] 3A0032EF [Document] important.pdf
2024-03-27 10:28:45 Alice [email protected] 3A0032D0 Are you free tomorrow?
...
JSON output:
wacli messages search)The search command performs a full-text search on your message history.
Note on Full-Text Search (FTS5): If wacli was built with the sqlite_fts5 tag (as recommended in [Getting Started]), search operations will utilize SQLite's FTS5 module, providing faster and more advanced search capabilities, including snippets of matching text. If not, it will fall back to a slower LIKE query. The wacli doctor command can tell you if FTS5 is enabled.
<query>: The search query string.--chat JID: Filter search results to a specific chat JID.--from JID: Filter search results to messages sent by a specific sender JID.--limit N: Limit the number of results (default: 50).--after TIME: Only include messages sent after the specified time.--before TIME: Only include messages sent before the specified time.--type TYPE: Filter by media type (image, video, audio, document).Human-readable output (with FTS5 snippet):
TIME CHAT FROM ID MATCH
2024-03-25 09:15:00 Work Updates me 3A0021A0 Here's the [meeting] [agenda] for tomorrow.
2024-03-24 14:00:00 Project X Team [email protected] 3A001F2B Can we discuss the [meeting] [agenda]?
...
JSON output:
wacli messages show)The show command displays the full details of a single message, including its text, media type, and sender.
--chat JID: The JID of the chat the message belongs to.--id MESSAGE_ID: The unique ID of the message.Human-readable output:
Chat: [email protected]
Chat name: Alice
ID: 3A003310
Time: 2024-03-27T10:30:05Z
From: me
Hello there!
JSON output:
wacli messages context)The context command allows you to view messages immediately before and after a specified message ID within a chat.
--chat JID: The JID of the chat the message belongs to.--id MESSAGE_ID: The unique ID of the central message.--before N: Number of messages to show before the central message (default: 5).--after N: Number of messages to show after the central message (default: 5).To view 2 messages before and 3 messages after message 3A003310 in chat [email protected]:
Human-readable output:
TIME FROM ID TEXT
2024-03-27 10:28:45 [email protected] 3A0032D0 Are you free tomorrow?
2024-03-27 10:29:01 me 3A0032E0 I am! What's up?
2024-03-27 10:30:05 me >> Hello there!
2024-03-27 10:30:15 [email protected] 3A00331A Great, let's chat.
2024-03-27 10:31:00 me 3A00332C Sounds good!
2024-03-27 10:31:30 [email protected] 3A00333E I wanted to ask about...
JSON output: