https://github.com/gitstq/wapi
WhatsApp Business Automation CLI - YAML-driven WhatsApp messaging automation tool
https://github.com/gitstq/wapi
Last synced: 3 days ago
JSON representation
WhatsApp Business Automation CLI - YAML-driven WhatsApp messaging automation tool
- Host: GitHub
- URL: https://github.com/gitstq/wapi
- Owner: gitstq
- License: mit
- Created: 2026-04-17T00:22:43.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-17T03:09:55.000Z (2 months ago)
- Last Synced: 2026-04-17T05:15:06.265Z (2 months ago)
- Language: Python
- Homepage: https://github.com/gitstq/wapi
- Size: 75.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wapi - WhatsApp Business Automation CLI
đ **Language / č¯č¨**īŧ[English](README.md) | [įŽäŊ䏿](README_zh-CN.md) | [įšäŊ䏿](README_zh-TW.md)
đ | YAML-driven WhatsApp Business Automation | CLI-first | Zero Learning Curve
---
## đ¯ Introduction
**wapi** is a powerful WhatsApp Business automation CLI tool designed for developers and businesses. Using YAML configuration files as the driving force, it enables command-line operations for message sending, contact management, mass broadcasting, scheduled tasks, and more.
### đĨ Core Value
- **đŦ YAML-configured Message Sending** - Say goodbye to repetitive work, batch send with one click
- **đĨ Smart Contact Management** - Groups, tags, and search - all you need
- **â° Automated Scheduled Tasks** - Set it and forget it
- **đĄī¸ Anti-ban Strategy** - Intelligent sending intervals to protect your account
- **đ Multiple Output Formats** - Terminal table/JSON/Markdown, flexible display
### đĄ Inspiration
Inspired by WhatsApp CLI community innovations, focusing on providing developers with:
- More powerful YAML configuration capabilities
- More complete contact management system
- Smarter anti-ban strategies
- More flexible message template engine
---
## ⨠Features
| Feature | Description |
|---------|-------------|
| đ **WhatsApp Web Integration** | Selenium-based, no extra API required |
| đ **YAML Message Config** | Template messages with variable substitution |
| đĨ **Contact Management** | Groups, tags, import/export |
| đ¤ **Mass Broadcasting** | Large-scale sending with anti-ban strategy |
| â° **Scheduled Tasks** | Daily/interval/custom scheduling |
| đ **Send Logs** | Complete message sending records |
| đ¨ **Rich Beautified Output** | Colorful terminal, table display |
---
## đ Quick Start
### đĻ Installation
```bash
# Install from source
git clone https://github.com/gitstq/wapi.git
cd wapi
pip install -e .
# Or install directly
pip install wapi
```
### đ§ Requirements
- Python 3.8+
- Chrome/Firefox browser
- ChromeDriver/GeckoDriver (auto-installed)
- Valid WhatsApp account
### đ Initial Setup
```bash
# Initialize config directory
wapi config --init
```
### đŦ Send a Single Message
```bash
# Send message to a contact
wapi send single --to "+8613812345678" --message "Hello from wapi!"
# Use message template
wapi send single --to "+8613812345678" --template greeting
```
### đ¤ Batch Sending
Create message config file `messages.yaml`:
```yaml
messages:
- to: "+8613812345678"
message: "Hello, this is a test message"
- to: "+8613898765432"
message: "Greetings from wapi!"
```
Execute batch sending:
```bash
# Preview mode
wapi send batch --file messages.yaml --dry-run
# Actual sending
wapi send batch --file messages.yaml
```
---
## đ Detailed Usage Guide
### đĨ Contact Management
```bash
# Add contact
wapi contact add --name "John" --phone "+8613812345678" --group "Friends" --tags "Important,Work"
# List contacts
wapi contact list
# Filter by group
wapi contact list --group "Friends"
# Filter by tag
wapi contact list --tag "Important"
# Delete contact
wapi contact delete 12345678
```
### đ Message Templates
```bash
# Create template
wapi template create --name "greeting" --template "Hello {name}! {message}" --description "General greeting template"
# List all templates
wapi template list
# Send using template
wapi send single --to "+8613812345678" --message "Hello John! This is a template message"
```
### â° Scheduled Tasks
```bash
# List scheduled tasks
wapi schedule list
# Run task immediately
wapi schedule run 12345678
```
### đ WhatsApp Status Check
```bash
# Check connection status
wapi status
```
---
## đĄ Design Philosophy
### đ¯ Core Principles
1. **CLI-first** - All features operated via command line, no GUI required
2. **YAML-driven** - Complex tasks defined in YAML files, simple and efficient
3. **Zero external dependencies (optional)** - Core features only need standard library
4. **Built-in anti-ban strategy** - Auto-handles sending intervals to reduce account risk
### đī¸ Technical Architecture
```
wapi/
âââ cli.py # Click CLI entry point
âââ core/ # Core functionality modules
â âââ browser.py # Browser driver management
â âââ sender.py # Message sending core
â âââ contact.py # Contact management
â âââ scheduler.py # Scheduled tasks
âââ config/ # Configuration module
â âââ loader.py # Config loader
âââ templates/ # Message template directory
âââ logs/ # Send log directory
```
### đŽ Future Roadmap
- [ ] Support more message types (images, files, videos)
- [ ] Web interface management
- [ ] Multi-account support
- [ ] Cloud sync configuration
- [ ] API service mode
---
## đĻ Packaging & Deployment
### đ¨ Development Installation
```bash
# Clone project
git clone https://github.com/gitstq/wapi.git
cd wapi
# Install dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
```
### đŗ Docker Deployment
```dockerfile
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y chromium && rm -rf /var/lib/apt/lists/*
RUN pip install wapi selenium webdriver-manager
CMD ["wapi", "status"]
```
### đą Cross-platform Packaging
```bash
# Windows
pyinstaller --onefile --console wapi/cli.py
# macOS/Linux
pyinstaller --onefile --console wapi/cli.py
```
---
## đ¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
---
## đ License
This project is licensed under the [MIT License](LICENSE).
---
Made with â¤ī¸ by gitstq