A minimal terminal-based WhatsApp client built with TypeScript, whatsapp-web.js, and Node.js readline.
- Clean CLI interface with colored output
- QR code authentication in terminal
- Menu-driven commands with settings panel
- Send and receive messages
- AI Message Generation support (OpenRouter, OpenAI, Gemini)
- Session persistence - no re-authentication needed after restart
- Production-ready and minimal
# Install dependencies
bun install
# Run in development
bun dev
# Build for production
bun run build
# Start the CLI
bun start- Node.js: v18+ or Bun: v1.0+
- Chrome/Chromium: Latest version
- Memory: Minimum 2GB RAM
Set the Chrome path for Puppeteer:
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"- Run
bun start - Scan the QR code with your WhatsApp app
- Session is saved automatically for next time
1. List chats - Show all your WhatsApp chats
2. Select chat - Choose a chat to work with
3. Send message - Send a message to the selected chat
4. Show chat history - Display last 15 messages from chat
5. Toggle AI mode - Enable/disable AI message generation
6. Settings - Configure AI provider, model, temperature, tokens
7. Logout & reset - Clear auth token and force re-scan QR code
8. Exit - Close the application
Configure AI providers in Settings (option 6):
# Set API keys
export OPENROUTER_API_KEY=your_key_here
export OPENAI_API_KEY=your_key_here
export GEMINI_API_KEY=your_key_hereSupported providers:
- OpenRouter - Multi-model support (Claude, GPT, PaLM)
- OpenAI - GPT-3.5, GPT-4 models
- Google Gemini - Gemini AI models
# Format code
bun run format
# Type check
bun run typecheck
# Lint
bun run lint
bun run lint:fix
# Build
bun run buildsrc/
├── cli.ts # Main CLI entry point
├── client.ts # WhatsApp Web.js wrapper
├── ui.ts # Chalk-based UI utilities
├── config.ts # Configuration management
├── settings.ts # Interactive settings menu
└── readline-utils.ts # CLI input utilities
Verify Chrome installation and set PUPPETEER_EXECUTABLE_PATH.
Delete .wwebjs_auth_session/ directory and re-scan QR code.
Chrome headless mode uses ~150-300MB RAM. This is normal.
MIT
Built with Claude Code | Documentation