Skip to content

Send messages

PyWacli sends messages through the live Connect session — so you don't open a second WhatsApp socket. There are two ways in: the interactive flow and a one-shot command.

Interactive send

From the menu pick 4 · Send, or rely on the prompts:

  1. Pick a contact — recent contacts and contacts seen in your database are listed; choose one by number, or type a new phone number (digits only, with country code, e.g. 919876543210).
  2. Pick a message — choose a quick message (Hello!, Thank you!, On my way, …) or type 0 for a custom message.
  3. What next? — Undo (send again), enter a New number, or go Back to the menu.

Requires a running Connect session

The interactive send talks to the local command server hosted by pywacli connect. If no session is running you'll see "WhatsApp service not reachable — start Connect in another terminal first."

One-shot command

Send a single message non-interactively:

pywacli send --phone 919876543210 --message "Hello from PyWacli!"

If you omit the options, PyWacli prompts for them:

pywacli send
# Phone: 919876543210
# Message: Hello from PyWacli!

Phone numbers are normalized automatically — +, spaces, and dashes are stripped.

How delivery works

sequenceDiagram
  participant U as You (Send)
  participant S as Connect session
  participant B as Baileys bridge
  participant W as WhatsApp
  U->>S: message via local command server
  S->>B: write to node stdin
  B->>W: send over WhatsApp socket
  W-->>B: delivery

Recent recipients are remembered (most-recent first, up to 20) so they're quick to pick next time.