{"id":10109,"date":"2024-12-02T14:00:50","date_gmt":"2024-12-02T14:00:50","guid":{"rendered":"https:\/\/cheapwindowsvps.com\/blog\/sending-whatsapp-messages-from-the-command-line-a-step-by-step-guide\/"},"modified":"2025-01-20T11:26:55","modified_gmt":"2025-01-20T11:26:55","slug":"sending-whatsapp-messages-from-the-command-line-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/cheapwindowsvps.com\/blog\/sending-whatsapp-messages-from-the-command-line-a-step-by-step-guide\/","title":{"rendered":"Sending WhatsApp Messages from the Command Line: A Step-by-Step Guide"},"content":{"rendered":"<p>You can utilize the Mudslide console client to send WhatsApp messages directly from the command line or within scripts, which is especially convenient for system administrators who wish to dispatch notifications through automation processes.<\/p>\n<p>Mudslide is built on the <strong>Baileys<\/strong> library, an unofficial open-source solution enabling interaction with the WhatsApp Web API via WebSockets, and is available on <a href=\"https:\/\/github.com\/robvanderleek\/mudslide\" target=\"_blank\" rel=\"nofollow noopener\">GitHub<\/a>.<\/p>\n<p>To begin, ensure that your machine has <strong>Node.js<\/strong> (along with the <strong>NPM<\/strong> package manager) and <strong>Git<\/strong> client installed. Guidance on installing Node.js can be found <a href=\"https:\/\/woshub.com\/install-node-js-npm-windows\/\" target=\"_blank\" rel=\"nofollow noopener\">here<\/a>, while Git can be acquired via an MSI installer or through the <a href=\"https:\/\/woshub.com\/using-winget-package-manager-windows\/\" target=\"_blank\" rel=\"nofollow noopener\">WinGet<\/a> command:<\/p>\n<pre><code class=\"language-bash\">winget install --id Git.Git -e --source winget<\/code><\/pre>\n<p>Once your setup is complete, install the Mudslide package and its dependencies using the command:<\/p>\n<pre><code class=\"language-bash\">npm install -g mudslide<\/code><\/pre>\n<p>To execute Mudslide from the command line, utilize the <strong>npx<\/strong> tool. Start by checking the available options:<\/p>\n<pre><code class=\"language-bash\">npx mudslide -v<\/code><\/pre>\n<p>The Mudslide client requires you to authenticate it as a secondary WhatsApp client. To login, run:<\/p>\n<pre><code class=\"language-bash\">npx mudslide login<\/code><\/pre>\n<p>This command will generate a QR code for scanning with the WhatsApp app on your smartphone (navigate to <strong>Settings<\/strong> -&gt; <strong>Linked Devices<\/strong> -&gt; <strong>Link a device<\/strong>).<\/p>\n<p>Upon successful authentication, you will receive a notification in the command prompt:<\/p>\n<pre><code>Success: Logged in<\/code><\/pre>\n<p>To test your setup, send a message to yourself:<\/p>\n<pre><code class=\"language-bash\">npx mudslide send me \"Hello World\"<\/code><\/pre>\n<p>Additionally, to message another user, use their phone number (saving the number in contacts beforehand is not necessary):<\/p>\n<pre><code class=\"language-bash\">npx mudslide send 4998765432188 \"Hello World\"<\/code><\/pre>\n<p>You can also send messages in one of your WhatsApp groups using the group ID format or tweak the command to introduce line breaks:<\/p>\n<pre><code class=\"language-bash\">npx mudslide send 4998765432188 \"HelloWorld\"<\/code><\/pre>\n<p>Mudslide allows sending images and files too, support for formats like PNG, JPG, and PDF is included:<\/p>\n<pre><code class=\"language-bash\">npx mudslide send-image 4998765432100 C:srcimage123.jpgnpx mudslide send-file 4998765432100 C:srcscan.pdf<\/code><\/pre>\n<p>You can even share location coordinates:<\/p>\n<pre><code class=\"language-bash\">npx mudslide@latest send-location me 48.159731 11.560668<\/code><\/pre>\n<p>For messaging groups:<\/p>\n<pre><code class=\"language-bash\">npx mudslide send-group 12345678910 \"Hello\"<\/code><\/pre>\n<p>Check your authentication status whenever needed by running:<\/p>\n<pre><code class=\"language-bash\">npx mudslide me<\/code><\/pre>\n<p>To log out and delete the session data, use:<\/p>\n<pre><code class=\"language-bash\">npx mudslide logout<\/code><\/pre>\n<p>Compiled versions of Mudslide are also available for download for other platforms, such as Linux.<\/p>\n<p>By employing the Mudslide client, it&#8217;s possible to send WhatsApp messages directly from scripts or monitoring systems without relying on browsers or automation tools like Selenium.<\/p>\n<p>For other related scripting instructions, explore:<\/p>\n<ul>\n<li><a href=\"https:\/\/woshub.com\/send-telegram-message-powershell\/\" target=\"_blank\" rel=\"nofollow noopener\">Send Telegram Messages from PowerShell<\/a><\/li>\n<li><a href=\"https:\/\/woshub.com\/send-message-teams-channel-powershell\/\" target=\"_blank\" rel=\"nofollow noopener\">How to use PowerShell to send a message to the Teams channel<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>You can utilize the Mudslide console client to send WhatsApp messages directly from the command line or within scripts, which is especially convenient for system administrators who wish to dispatch notifications through automation processes. Mudslide is built on the Baileys library, an unofficial open-source solution enabling interaction with the WhatsApp Web API via WebSockets, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10110,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[116,117,99,108],"tags":[],"class_list":["post-10109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-powershell","category-windows-11","category-windows-server-2022"],"_links":{"self":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/10109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/comments?post=10109"}],"version-history":[{"count":1,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/10109\/revisions"}],"predecessor-version":[{"id":10428,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/10109\/revisions\/10428"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media\/10110"}],"wp:attachment":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media?parent=10109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/categories?post=10109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/tags?post=10109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}