Multi-Agent Collaboration CLI with flock-based locking and event-driven workflow
Project description
Mai CLI
English | 简体中文
Multi-Agent Coordination CLI — enables multiple AI agents to collaborate autonomously via a standardized command interface, backed by flock-based atomic locking.
✨ Features
- 🔒 Atomic flock locks — race-condition-free claim/complete via POSIX
fcntl.flock() - 📋 Standardized commands — full Issue lifecycle, queue scanning, lock management, audit logs, daily summaries
- 📁 Dual-layer storage —
.mai/as internal source,async/as human-readable mirror - ⚙️ JSON configuration — queue SLA, agent heartbeat, issue ID prefix all in
config.json - 🔄 Concurrent-safe daily summaries — multiple agents write simultaneously with flock protection
- 🌍 Global Infrastructure — centralized management of global config and project registry in
~/.mai-cli/(v1.10.0+) - ✅ Idempotent writes — repeating any operation preserves state
- 📦 Zero dependencies — Python 3 stdlib only
🏗️ Architecture
flowchart TB
subgraph Storage
A[".mai/ — internal source"]
B["async/ — human-readable mirror"]
end
subgraph Core
C["Issue Queue"]
D["flock Lock"]
E["Heartbeat Guardian"]
end
subgraph Commands
F["mai issue"]
G["mai queue"]
H["mai lock"]
I["mai daily-summary"]
end
F --> C
G --> C
H --> D
I --> C
C --> A
A --> B
🚀 Quick Start
Requirements
- Python 3.8+ (stdlib only, no external dependencies)
- Linux / macOS / WSL (POSIX environment)
Install
pip install mai-cli
Minimal Example
# 1. Initialize project
mai init
# 2. Register an agent
mai agent add alice --heartbeat-minutes 30
# 3. Create an issue
mai issue new questions "Technical review" -o alice
# 4. Claim issue (auto-locks)
mai issue claim REQ-001 -o alice
# 5. Complete issue
mai issue complete REQ-001 "Approved for implementation" -o alice
# 6. Check queue
mai queue check --overdue
📖 Documentation
| Document | Description |
|---|---|
| Deployment | Deployment guide |
| Command Reference | Full command reference |
🤝 Contributing
PRs and Issues are welcome!
- Fork this project
- Create a feature branch
git checkout -b feature/AmazingFeature - Commit your changes
git commit -m 'feat: Add some AmazingFeature' - Push to the branch
git push origin feature/AmazingFeature - Open a Pull Request
📄 License
MIT License — see LICENSE.
Mai CLI v1.9.2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mai_cli-1.10.1.tar.gz.
File metadata
- Download URL: mai_cli-1.10.1.tar.gz
- Upload date:
- Size: 42.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68baadf5fcd224ad443d60930a4811842387ea99f389dbeff3ddc8853500188
|
|
| MD5 |
9d306b42816142e949525d468c622477
|
|
| BLAKE2b-256 |
bcb2bacfbb9765650740bb4eddb0a1e44a01717556e4c80844041a57df7b88ce
|
File details
Details for the file mai_cli-1.10.1-py3-none-any.whl.
File metadata
- Download URL: mai_cli-1.10.1-py3-none-any.whl
- Upload date:
- Size: 39.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
250eb985636b4048b897bbf87ee74bd895d8bdadc81f0a95ce0602c1324825fa
|
|
| MD5 |
3f5364d80238df65253f73e305ddfa21
|
|
| BLAKE2b-256 |
3ca550a3f1b756a796f737e3a4c787c9d36467899f920f57d1afa93fb6165555
|