Multi-Agent Collaboration CLI with flock-based locking and event-driven workflow
Project description
Agent Pulse
Multi-Agent Collaboration CLI — flock-based coordination, event-driven workflow, zero overhead.
Pulse is a command-line tool that coordinates multiple AI agents working on a shared project. It provides atomic locking, queue-based issue routing, per-agent heartbeat timeouts, and an automated daily summary loop — all backed by a simple file-based store.
Features
- Atomic flock locks — race-condition-free claim/complete cycles via POSIX
fcntl - Queue-based routing — issues route to the right agent with configurable SLA per queue
- Heartbeat-aware guardian — stale locks auto-release after
heartbeat × 1.5minutes - Event-driven daily summary — ordered turn-taking with idempotent trigger/collect
- Async mirror —
.pulse/internal store syncs toasync/for human visibility - Configurable via JSON — all rules externalized to
config.json; no code changes needed - Dual output format —
--format jsonfor machine consumption, text for humans - Dry-run mode —
--dry-runpreviews every mutation without side effects
Installation
pip install mai-cli
Or install from source:
git clone https://github.com/yourname/mai-cli.git
cd mai-cli
pip install -e .
Quick Start
Step 1 — Initialize a project
pulse project init MyProject
Step 2 — Create an issue
pulse --project MyProject issue new programmer-questions "How should we handle input buffering?"
Step 3 — Have the assigned agent claim it
pulse --project MyProject issue claim REQ-001
Step 4 — Mark it done
pulse --project MyProject issue complete REQ-001 "Decision: ring buffer, 60Hz polling"
Step 5 — Inspect queues
pulse --project MyProject queue check
Architecture
.pulse/ async/
├── queues/<queue>/ Issue files <queue>/ Human-visible mirror
├── locks/ flock files (internal only)
├── processing/ Active issues <queue>/
├── decisions/ Conclusion logs decisions/
├── history/ Audit logs history/
├── events/ Daily-summary triggers (internal only)
└── config.json All collaboration rules
Lock protocol: When an agent claims an issue, Pulse acquires an flock(2)-based file lock. The lock expires after heartbeat × 1.5 minutes if the agent fails to heartbeat. The lock guardian cron command automatically releases stale locks.
Daily summary flow: trigger → each agent write in order → collect merges all summaries into a single report.
Command Reference
Issue
pulse issue new <queue> <title> [--ref REQ-XXX]
pulse issue amend <issue-id> <remark>
pulse issue claim <issue-id>
pulse issue complete <issue-id> <conclusion>
pulse issue list [queue]
pulse issue show <issue-id>
pulse issue escalate <issue-id>
Queue
pulse queue check [queue] [--overdue]
pulse queue blockers
Lock
pulse lock check <issue-id>
pulse lock force-release <issue-id>
pulse lock guardian
Log
pulse log history [--date YYYY-MM-DD] [--agent NAME]
pulse log write <agent> <type> <summary> [status]
Daily Summary
pulse daily-summary trigger
pulse daily-summary write <agent> <content...>
pulse daily-summary collect
Escalation
pulse escalation gen <issue-id>
Bitable
pulse bitable sync-status
pulse bitable retry
Project
pulse project init <project-name>
Configuration
Edit .pulse/config.json in your project root:
{
"queues": {
"programmer-questions": {
"handler": "designer",
"sla_minutes": 120,
"id_prefix": "REQ"
}
},
"agents": {
"programmer": { "heartbeat_minutes": 17 },
"designer": { "heartbeat_minutes": 29 }
},
"daily_summary_order": ["programmer", "designer", "architect", "narrative", "techartist"]
}
Legacy field compatibility
owner → handler, sla_hours → sla_minutes are automatically converted.
Supported Platforms
- OS: Linux / macOS (POSIX required for
flock) - Python: 3.8, 3.9, 3.10, 3.11, 3.12
License
MIT License — see LICENSE for the full text.
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.1.0.tar.gz.
File metadata
- Download URL: mai_cli-1.1.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a02dabf14f2e3e1a3df661b7d0bb361de903605395c87bbf10e52ce991841bc2
|
|
| MD5 |
c93f1e5d7fe813afa9d939aa50d17667
|
|
| BLAKE2b-256 |
197383e6be06a3726d0847859f20eb75046ddaf9bc28392a14525e01765c9d3c
|
File details
Details for the file mai_cli-1.1.0-py3-none-any.whl.
File metadata
- Download URL: mai_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 25.9 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 |
6af6de969c5f8219c3c70da6fe88ce8122658af25f244548d7fc8e44b43d0a0b
|
|
| MD5 |
89282d8debdfc63356c1cba435f57076
|
|
| BLAKE2b-256 |
6d75720455d688eb234d490b304aeb27bcd625cd65fe3bd8f4b8ba42318d1ec7
|