Loading...
Loading...
Interact with WhatsApp using Cloud API credentials - send messages, manage templates
npx skill4agent add devxoul/agent-messenger agent-whatsappbotwhatsapp_business_messaging# Set your API credentials
agent-whatsappbot auth set your-phone-number-id your-access-token
# Verify authentication
agent-whatsappbot auth status
# Send a text message (recipient must have messaged you within 24h)
agent-whatsappbot message send 15551234567 "Hello from the CLI!"
# List available message templates
agent-whatsappbot template list --pretty# Set credentials (validates against WhatsApp Cloud API before saving)
agent-whatsappbot auth set your-phone-number-id your-access-token
# Check auth status
agent-whatsappbot auth status
# Clear stored credentials
agent-whatsappbot auth clear# List stored accounts
agent-whatsappbot auth list
# Switch active account
agent-whatsappbot auth use <account-id>
# Remove a stored account
agent-whatsappbot auth remove <account-id>~/.config/agent-messenger/MEMORY.mdReadWrite~/.config/agent-messenger/MEMORY.mdRead~/.config/agent-messenger/MEMORY.mdWriteauth listauth statustemplate listtemplate getWriteMEMORY.md# Agent Messenger Memory
## WhatsApp Accounts
- `112233445566` - Acme Notifications (Phone: +1 555 012 3456)
## Templates (Acme Notifications)
- `order_confirmation` - language: en_US, params: [customer_name, order_id]
- `shipping_update` - language: en_US, params: [customer_name, tracking_number]
- `appointment_reminder` - language: en_US, params: [customer_name, date, time]
## Frequent Recipients
- `15559876543` - Support escalation line
- `15551112222` - QA test number
## Aliases
- "notifications" -> `112233445566` (Acme Notifications)
## Notes
- order_confirmation template requires customer_name and order_id as components
- Business verified at Tier 2 (80 MPS limit)Memory lets you skip repeatedcalls. When you already know a template name from a previous session, use it directly.template list
# Set account credentials (validates against API)
agent-whatsappbot auth set <phone-number-id> <access-token>
# Check auth status
agent-whatsappbot auth status
agent-whatsappbot auth status --account <account-id>
# List stored accounts
agent-whatsappbot auth list
# Switch active account
agent-whatsappbot auth use <account-id>
# Remove a stored account
agent-whatsappbot auth remove <account-id>
# Clear all credentials
agent-whatsappbot auth clear# Show current authenticated bot
agent-whatsappbot whoami
agent-whatsappbot whoami --pretty
agent-whatsappbot whoami --account <account-id># Send a text message
agent-whatsappbot message send <to> <text>
agent-whatsappbot message send 15551234567 "Your order has shipped!"
# Send a template message
agent-whatsappbot message send-template <to> <template-name>
agent-whatsappbot message send-template 15551234567 order_confirmation --language en_US --components '[{"type":"body","parameters":[{"type":"text","text":"Alice"},{"type":"text","text":"ORD-9876"}]}]'
# Send a reaction to a message
agent-whatsappbot message send-reaction <to> <message-id> <emoji>
agent-whatsappbot message send-reaction 15551234567 wamid.abc123 "👍"
# Send an image
agent-whatsappbot message send-image <to> <url>
agent-whatsappbot message send-image 15551234567 "https://example.com/photo.jpg" --caption "Product photo"
# Send a document
agent-whatsappbot message send-document <to> <url>
agent-whatsappbot message send-document 15551234567 "https://example.com/invoice.pdf" --filename "invoice.pdf" --caption "Your invoice"# List message templates
agent-whatsappbot template list
agent-whatsappbot template list --limit 20
# Get template details
agent-whatsappbot template get <template-name>
agent-whatsappbot template get order_confirmation{
"messaging_product": "whatsapp",
"contacts": [{ "input": "15551234567", "wa_id": "15551234567" }],
"messages": [{ "id": "wamid.HBgNMTU1NTEyMzQ1NjcVAgA..." }]
}--prettyagent-whatsappbot template list --pretty| Option | Description |
|---|---|
| Human-readable output instead of JSON |
| Use a specific account for this command |
references/common-patterns.md# List templates to find the right one
agent-whatsappbot template list --pretty
# Get template details to see required parameters
agent-whatsappbot template get order_confirmation --pretty
# Send the template message
agent-whatsappbot message send-template 15551234567 order_confirmation \
--language en_US \
--components '[{"type":"body","parameters":[{"type":"text","text":"Alice"},{"type":"text","text":"ORD-9876"}]}]'agent-whatsappbot message send 15551234567 "Thanks for reaching out! We'll look into this right away."agent-whatsappbot message send-document 15551234567 "https://example.com/receipt.pdf" \
--filename "receipt-2024-01.pdf" \
--caption "Here's your receipt for January"agent-whatsappbot message send-template 15559876543 deployment_alert \
--language en_US \
--components '[{"type":"body","parameters":[{"type":"text","text":"v2.1.0"},{"type":"text","text":"production"},{"type":"text","text":"success"}]}]'templates/post-message.shaccount-summary.shsend-template.sh{
"error": "No credentials. Run \"auth set <phone-number-id> <access-token>\" first."
}No credentialsAccount not foundTemplate not foundInvalid phone number formatMessage failed to send (outside 24h window, use a template)~/.config/agent-messenger/whatsappbot-credentials.json{
"current": { "account_id": "112233445566" },
"accounts": {
"112233445566": {
"account_id": "112233445566",
"phone_number_id": "112233445566",
"phone_number": "+1 555 012 3456",
"access_token": "..."
}
}
}| Feature | agent-whatsapp | agent-whatsappbot |
|---|---|---|
| Auth type | User account (Baileys, QR/pairing) | Cloud API (Phone Number ID + Token) |
| Token source | Pairing flow with phone number | Meta Business Manager |
| Read messages | Yes | No (webhook-only inbound) |
| Group chats | Yes | No |
| Template messages | No | Yes (required outside 24h window) |
| Free-form text | Anytime | Only within 24h customer window |
| Media uploads | Direct (local files) | URL only |
| Multi-account | Multi-phone, single CLI session | Multi-account by Phone Number ID |
| CI/CD friendly | Requires phone, pairing flow | Yes (just set token) |
agent-whatsappbot: command not foundagent-whatsappbotagent-messengeragent-whatsappbotagent-whatsappbot message send 15551234567 "Hello"npx -ynpx -y agent-messenger whatsappbot message send 15551234567 "Hello"Note: If the user prefers a different package runner (e.g.,,bunx,pnpx), use that instead.pnpm dlx
npx agent-whatsappbotbunx agent-whatsappbotpnpm dlx agent-whatsappbotagent-whatsappbotwhatsapp_business_messagingagent-whatsappbot auth set <phone-number-id> <access-token>agent-whatsappbot template get <name>APPROVEDPENDINGREJECTED--language--components+15551234567+1-555-123-4567message send-templatemessage send