///
`wacli` provides functionalities for both downloading media from synced messages and sending media files to chats. This page details how to use these features.
307 views
~307 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.
wacli provides functionalities for both downloading media from synced messages and sending media files to chats. This page details how to use these features.
When wacli synchronizes message history (via wacli auth or wacli sync), it primarily stores message metadata, including information about media attachments (images, videos, audio, documents). By default, the actual media files are not downloaded during sync to save local storage and bandwidth. However, wacli allows you to download these files on demand.
wacli media downloadThis command is used to download a specific media attachment associated with a synced message.
--chat <chat-jid> (Required): The Jabber ID (JID) of the chat where the message containing the media was sent. Examples: [email protected] for a direct message, or [email protected] for a group.--id <message-id> (Required): The unique ID of the message that contains the media attachment. You can find this ID using wacli messages list or wacli messages search.--output <path> (Optional): Specifies where to save the downloaded file.
/ or recognized as a directory), the file will be saved inside that directory using its default filename.wacli defaults to saving media in a structured path within your ~/.wacli store directory: ~/.wacli/media/<chat_jid>/<message_id>/<media_type>/<filename>.For instance, an image from chat [email protected] with message ID ABC123DEF456 might be stored at:
~/.wacli/media/123_s.whatsapp.net/ABC123DEF456/image/picture.jpg
To download an image from a chat:
You can configure wacli sync or wacli auth to automatically download media files in the background as they are synced:
When --download-media is enabled, wacli will enqueue media downloads for newly synced messages. Downloads happen asynchronously in worker goroutines, attempting to save media to the default local storage path.
wacli supports sending various file types as WhatsApp messages.
wacli send fileThis command allows you to send an image, video, audio, or document file.
--to <recipient> (Required): The recipient's phone number (e.g., 1234567890) or JID (e.g., [email protected] for DMs, [email protected] for groups).--file <path-to-file> (Required): The local path to the file you want to send.--caption <text> (Optional): A text caption to accompany the media. This is typically used for images, videos, and documents.--mime <mime-type> (Optional): Overrides the automatically detected MIME type of the file. wacli attempts to detect the MIME type based on the file extension and content. If detection fails or you need to send with a specific MIME type, you can use this flag (e.g., --mime application/pdf).wacli determines the media type (image, video, audio, document) and MIME type in the following order:
--mime flag value if provided.ImageMessage, VideoMessage).To send a picture with a caption:
To send a PDF document:
Refer to the [Getting Started] page for more general information on wacli usage and installation.