A terminal WhatsApp client with a compact Matrix-style UI, built with TypeScript, React + Ink, and whatsapp-web.js.
- Full-screen Ink TUI with cyan/green Matrix theme
- Scrollable chat list and message pane (fixed terminal height)
- QR code authentication in the terminal
- Session persistence under
~/.whatsapp-cli/ - Auto-reconnect with visible connection status
- In-app logout and re-authentication (no process exit)
- Optional AI message generation (OpenRouter, OpenAI, Gemini)
- Keyboard-driven navigation
npm install -g @involvex/whatsapp-cliThen run:
whatsapp-cligit clone https://github.com/involvex/whatsapp-cli.git
cd whatsapp-cli
bun install
bun run build
bun start- Node.js 18+ (required for
npm install -gand production use) - Bun 1.0+ (optional, for local development)
- Chrome, Chromium, or Edge in a standard install location, or Puppeteer-managed Chrome
- RAM: ~2 GB minimum (headless browser)
The CLI resolves a browser in this order:
PUPPETEER_EXECUTABLE_PATHBUN_CHROME_PATH- Standard Chrome/Chromium/Edge paths
- Puppeteer's managed browser cache
Windows:
$env:PUPPETEER_EXECUTABLE_PATH = "C:\Program Files\Google\Chrome\Application\chrome.exe"macOS:
export PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"Linux:
export PUPPETEER_EXECUTABLE_PATH="/usr/bin/google-chrome"If no local browser is found:
npx puppeteer browsers install chrome- Start the CLI:
whatsapp-cliorbun start - Scan the QR code with WhatsApp on your phone
- Session data is saved to
~/.whatsapp-cli/auth/for later runs
| Key | Action |
|---|---|
↑ / ↓ |
Navigate chat list |
Enter |
Open highlighted chat |
Shift+Enter |
Type a message |
[1] |
Refresh chats / reconnect when offline |
[2] |
Select chat by number |
[3] |
Send message |
[4] |
Reload chat history |
[5] |
Toggle AI |
[6] |
Settings |
[7] |
About |
[8] |
Logout (clears session, shows QR again) |
Q |
Exit |
Esc |
Cancel message/select input |
Config file: ~/.whatsapp-cli/config.json
| Setting | Description |
|---|---|
theme |
matrix (default), default, dark, colorful |
autoReconnect |
Retry connection on disconnect (default: true) |
messageLimit |
Messages loaded per chat (default: 15) |
aiProvider |
AI provider, model, API key, temperature |
chatHistoryEnabled |
Persist chat history locally |
soundEnabled |
Terminal bell on new messages |
Set API keys in your environment:
export OPENROUTER_API_KEY=your_key_here
export OPENAI_API_KEY=your_key_here
export GEMINI_API_KEY=your_key_hereSupported providers: OpenRouter, OpenAI, Google Gemini.
bun install
bun dev # watch mode
bun run build # dist/cli.js + dist/cli-wrapper.js
bun run typecheck
bun run lintbun run build
npm publish --access publicprepublishOnly runs the build automatically. The published tarball includes only dist/, README.md, LICENSE, and Security.md.
src/
├── cli.tsx # Ink app entry + command handling
├── client.ts # whatsapp-web.js lifecycle
├── config.ts # ~/.whatsapp-cli config paths
├── theme.ts # TUI color themes
├── components/ # App, Sidebar, MainContent, Footer
└── hooks/ # Terminal size + scroll viewport
- Install Chrome, Chromium, or Edge.
- Set
PUPPETEER_EXECUTABLE_PATHto the browser executable. - Or run
npx puppeteer browsers install chrome.
rm -rf ~/.whatsapp-cli/auth
whatsapp-cliThen scan the QR code again.
- Footer shows
RECONNECTING (n/3)during auto-reconnect. - Press
[1]to manually refresh or reconnect. - Set
"autoReconnect": falsein config to disable auto-retry.
Headless Chrome typically uses 150–300 MB RAM. This is expected.
MIT — see LICENSE.