WhatsApp in your terminal, for you and your AI agents
Read chats, search every message and send from the command line. Or let Claude Code, Codex, OpenClaw and other agents that run commands do it for you.
npx whatsync loginWhat is the WhatSync CLI?
A command-line tool for your WhatsApp. Run npx whatsync login, sign in once in your browser, and you can list chats, read and search messages, see who is waiting on you, and send messages from the terminal. Every WhatSync tool is a command, so images, polls, groups and Business templates work too.
- Start
- npx whatsync login. Nothing to install first.
- Sign in
- Your browser, once. No API keys.
- Runs on
- macOS, Linux and Windows with Node.js 18 or newer
Get started
Two minutes if your WhatsApp is already linked to WhatSync.
Sign in
Run this in your terminal. It downloads the CLI and opens your browser; sign in to WhatSync and allow access. You stay signed in. No API keys and no config files.
npx whatsync loginLink your WhatsApp
Not linked yet? Open your WhatSync dashboard and link your personal WhatsApp from Linked devices on your phone, or connect the WhatsApp Business API.
Check it works
This shows which WhatsApp is connected. Every command works the same way:
npx whatsyncand the command.npx whatsync statusUsing it every day? Install it
Install it once and you can type
whatsyncinstead ofnpx whatsync. That is how the commands below are written.npm install -g whatsyncOn a server or over SSH
Add
--no-browser. The CLI prints the sign-in link; open it on any device, allow access, then paste the address your browser lands on back into the terminal.npx whatsync login --no-browser
Everyday commands
Did not install it? Put npx in front, like npx whatsync chats. Names and numbers both work; write numbers in international format, like 919876543210.
| Command | What it does |
|---|---|
| whatsync status | Shows which WhatsApp is connected |
| whatsync chats | Lists your recent chats |
| whatsync chats Ravi | Finds a chat by name or number |
| whatsync read Ravi | Shows the latest messages in that chat |
| whatsync search "invoice" | Searches every saved message |
| whatsync unanswered | Lists chats waiting for your reply |
| whatsync groups | Lists your groups |
| whatsync contacts Priya | Finds a contact |
| whatsync send 919876543210 "Your order is ready" | Sends a message to one person |
| whatsync send 120363012345678901@g.us "Received" | Sends a message to a group |
Every WhatSync tool is a command
Images, documents, polls, groups, Business templates, campaigns and settings all work the same way. The CLI reads the tool list from WhatSync, so new tools show up without an update.
Easier to pass JSON? Use --input '{...}' or --input @message.json.
whatsync tools # every tool, with what it does
whatsync help send-image # the options for one tool
whatsync send-image --phone-number 919876543210 --url https://example.com/photo.jpg --caption "Site photo"
whatsync send-poll --phone-number 919876543210 --name "Lunch?" --values Pizza --values Thali
whatsync list-business-templates --status APPROVEDBuilt for AI agents
Any agent that can run a terminal command can use your WhatsApp through the CLI.
Tell your agent it can use whatsync
One line in your prompt or instructions file is enough. The agent runs the commands like any other tool.
It gets JSON automatically
When an agent runs a command, the output is JSON, not a table. Add --json to force it. whatsync tools --json gives every tool with its full input.
Messages are information, not orders
Message text is written by other people. Tell your agent to treat it as information and to check with you before it sends anything.
Retries never send twice
If a send fails on a dropped connection, the CLI prints an --idempotency-key. Retry with it and WhatSync will not send the message twice.
CLI or MCP server?
Same WhatSync account, same tools, same limits. Pick by where your agent runs.
Use the MCP server
For AI chat apps like Claude, ChatGPT, Gemini and Perplexity, which cannot run terminal commands. Paste one URL and sign in.
WhatsApp MCP serverUse the CLI
For agents that run commands, like Claude Code, Codex, OpenClaw and Hermes, and for your own scripts and scheduled jobs. Sign in once with npx whatsync login.
All AI agentsGood to know
You choose which chats WhatSync saves, and you can unlink WhatsApp from your phone at any time. How we handle your data.
- Your sign-in is saved in ~/.config/whatsync/credentials.json, readable only by you, and renews itself.
whatsync logoutends it on the server too. - The CLI can do exactly what WhatSync lets Claude and ChatGPT do. The same permissions, send limits and excluded numbers apply.
- Sends are real WhatsApp messages. Double-check the number before you press enter.
- Search covers saved message text, file names and captions. Voice notes are not transcribed and text inside images is not read.
- Needs Node.js 18 or newer, on macOS, Linux or Windows.
Questions
Something else? Ask us.
Is there a WhatsApp CLI?
npx whatsync login to sign in, then use commands like whatsync chats, whatsync search and whatsync send. It works with your personal WhatsApp and the WhatsApp Business API.Do I need an API key?
whatsync login signs you in through your browser, the same way Claude and ChatGPT connect. Your sign-in renews itself.Can Claude Code or Codex use it?
npx whatsync login once, then tell the agent it can run npx whatsync (or whatsync if you installed it). Output is JSON when the agent runs it. They can also connect through the MCP server instead.Can I use it in scripts and scheduled jobs?
npm install -g whatsync so every run starts fast, and sign in once on that machine. Every command prints JSON when its output is piped. On a server, sign in with --no-browser.Can it send images, polls and Business templates?
whatsync tools to see them all. New tools appear without updating the CLI.How do I send to a group?
whatsync groups to find it, then whatsync send <group id> "message". Groups need a linked personal WhatsApp.Is it safe to let an agent send messages?
How much does it cost?
The CLI is published on npm as whatsync. Run whatsync --help for every command.