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 login

What 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.

  1. 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 login
  2. Link 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.

  3. Check it works

    This shows which WhatsApp is connected. Every command works the same way: npx whatsync and the command.

    npx whatsync status
  4. Using it every day? Install it

    Install it once and you can type whatsync instead of npx whatsync. That is how the commands below are written.

    npm install -g whatsync
  5. On 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.

WhatSync CLI everyday commands
CommandWhat it does
whatsync statusShows which WhatsApp is connected
whatsync chatsLists your recent chats
whatsync chats RaviFinds a chat by name or number
whatsync read RaviShows the latest messages in that chat
whatsync search "invoice"Searches every saved message
whatsync unansweredLists chats waiting for your reply
whatsync groupsLists your groups
whatsync contacts PriyaFinds 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 APPROVED

Built 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 server

Use 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 agents

Good 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 logout ends 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?

Yes. Run 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?

No. 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?

Yes. Run 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?

Yes. Install it with 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?

Yes. Every WhatSync tool is a command, including images, documents, polls, groups, Business templates and campaigns. Run whatsync tools to see them all. New tools appear without updating the CLI.

How do I send to a group?

Use the group id, which ends in @g.us. Run 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?

Only with care. Sends are real WhatsApp messages. Tell your agent to ask you before every send, and use your agent's own approval settings for commands. Bulk or unsolicited messages break WhatsApp's rules.

How much does it cost?

The CLI is free to install. It uses your WhatSync account; see the pricing page for plans.

The CLI is published on npm as whatsync. Run whatsync --help for every command.

Your WhatsApp, one command away

npx whatsync login