From agent-messenger
Sends messages and manages templates via WhatsApp Business Cloud API using TypeScript CLI with Phone Number ID and Access Token auth. For notifications, transactional messaging, AI agents, CI/CD.
npx claudepluginhub agent-messenger/agent-messenger --plugin agent-channeltalkbotThis skill is limited to using the following tools:
A TypeScript CLI tool that enables AI agents and humans to send messages through WhatsApp Business Cloud API. Designed for customer notifications, transactional messaging, and CI/CD integrations using Phone Number ID + Access Token authentication.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
A TypeScript CLI tool that enables AI agents and humans to send messages through WhatsApp Business Cloud API. Designed for customer notifications, transactional messaging, and CI/CD integrations using Phone Number ID + Access Token authentication.
Before diving in, a few things about WhatsApp Business Cloud API:
whatsapp_business_messaging permission.# 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
agent-whatsappbot uses Phone Number ID + Access Token pairs from Meta Business Manager:
# 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>
The agent maintains a ~/.config/agent-messenger/MEMORY.md file as persistent memory across sessions. This is agent-managed, the CLI does not read or write this file. Use the Read and Write tools to manage your memory file.
At the start of every task, read ~/.config/agent-messenger/MEMORY.md using the Read tool to load any previously discovered account IDs, template names, recipient numbers, and preferences.
After discovering useful information, update ~/.config/agent-messenger/MEMORY.md using the Write tool. Write triggers include:
auth list, auth status, etc.)template list, template get, etc.)When writing, include the complete file content. The Write tool overwrites the entire file.
Never store access tokens or any credentials. Never store full message content (just context). Never store personal user data.
If a memorized template returns an error (template not found, account invalid), remove it from MEMORY.md. Don't blindly trust memorized data. Verify when something seems off. Prefer re-listing over using a memorized value that might be stale.
# 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 repeated
template listcalls. When you already know a template name from a previous session, use it directly.
# 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
All commands output JSON by default for AI consumption:
{
"messaging_product": "whatsapp",
"contacts": [{ "input": "15551234567", "wa_id": "15551234567" }],
"messages": [{ "id": "wamid.HBgNMTU1NTEyMzQ1NjcVAgA..." }]
}
Use --pretty flag for formatted output:
agent-whatsappbot template list --pretty
| Option | Description |
|---|---|
--pretty | Human-readable output instead of JSON |
--account <id> | Use a specific account for this command |
Template messages are required when the customer hasn't messaged you in the last 24 hours. Always check your available templates first:
# 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"}]}]'
When a customer has messaged you within the last 24 hours, you can send any text:
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"}]}]'
All commands return consistent error format:
{
"error": "No credentials. Run \"auth set <phone-number-id> <access-token>\" first."
}
Common errors: No credentials, Account not found, Template not found, Invalid phone number format, Message failed to send (outside 24h window, use a template).
Credentials stored in ~/.config/agent-messenger/whatsappbot-credentials.json (0600 permissions).
Config format:
{
"current": { "account_id": "112233445566" },
"accounts": {
"112233445566": {
"account_id": "112233445566",
"phone_number_id": "112233445566",
"phone_number": "+1 555 012 3456",
"access_token": "..."
}
}
}
agent-whatsappbot: command not foundagent-whatsappbot is NOT the npm package name. The npm package is agent-messenger.
If the package is installed globally, use agent-whatsappbot directly:
agent-whatsappbot message send 15551234567 "Hello"
If the package is NOT installed, run it directly with npx -y:
npx -y agent-messenger whatsappbot message send 15551234567 "Hello"
Note: If the user prefers a different package runner (e.g.,
bunx,pnpx,pnpm dlx), use that instead.
NEVER run npx agent-whatsappbot, bunx agent-whatsappbot, or pnpm dlx agent-whatsappbot. It will fail or install a wrong package since agent-whatsappbot is not the npm package name.
whatsapp_business_messaging permissionagent-whatsappbot auth set <phone-number-id> <access-token>agent-whatsappbot template get <name>APPROVED (not PENDING or REJECTED)--language matches the template's language code exactly--components JSON matches the template's parameter structureWhatsApp enforces rate limits based on your business tier. The CLI automatically retries on rate limit (429) responses. For bulk operations, add delays between requests to avoid hitting limits.
+ prefix (e.g., 15551234567 not +1-555-123-4567)message send-template instead of message send