mirror of
https://github.com/wu736139669/OpsPilot.git
synced 2026-08-05 06:23:35 +00:00
Also adds session management APIs (kill/resume/window), auto-detection of Claude Code completion marks, Claude session listing, and session status indicators in the dashboard. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4.4 KiB
4.4 KiB
OpsPilot — AI Coding Agent Control Center
A task orchestration center for AI coding agents. Humans assign tasks, AI agents break them into steps, execute, and report progress — all visualized in real time.
Quick Start
pip3 install fastapi uvicorn websockets
python3 server.py
# Open http://localhost:5016
Default port is 5016, configurable via OPSPILOT_PORT environment variable.
Concept Model
Human (You) OpsPilot (Control Center) Claude Code (in tmux)
│ │ │
├─ Create project+task ───→ │ │
│ ├─ Create tmux session ────────→ │
│ ├─ Send task instructions ─────→ │
│ │ ├─ Break into steps
│ │ ├─ Write code
│ │ ├─ Pop up confirmation
│ │ ← Detect confirmation ────── │
│ ← Show confirm button ── │ │
├─ Click confirm ─────────→ │ ──→ Send confirmation ───────→ │
│ │ ├─ Continue
│ │ ← Step completion notice ─── │
│ ← Step progress update ─ │ │
│ │ ├─ All done
For AI Agents
If you are an AI Coding Agent (e.g., Claude Code) entering this project:
- Read this file to understand the project structure
- Run
python3 server.pyto start the control center - The control center provides a Web dashboard + REST API + WebSocket
- Use
/api/tmux/sessionto create tmux sessions and launch separate Claude Code instances - Use
/api/tmux/sendto send commands to agents in tmux - Use
/api/tmux/captureto capture agent output - Use
/api/tasksto manage tasks and step progress
Project Structure
OpsPilot/
├── server.py # FastAPI main (dashboard + API + WebSocket)
├── frontend/
│ └── dashboard.html # Single-page web dashboard
├── start.sh # Startup script
├── state/ # Runtime state (auto-generated)
│ ├── agents.json # Agent registry
│ ├── projects.json # Project registry
│ └── tasks.json # Tasks and steps
├── logs/ # Event logs
├── CLAUDE.md # This file
└── README.md
Core API
| Endpoint | Method | Purpose |
|---|---|---|
/ |
GET | Web dashboard |
/ws |
WS | Real-time state push (every 10s) |
/api/state |
GET | Full current state |
/api/projects |
POST | Register/update project |
/api/agents |
POST | Register/update agent |
/api/tasks |
POST | Create task (with step list) |
/api/tasks/{id}/start |
POST | Start a task |
/api/tasks/{id}/steps/{n}/complete |
POST | Complete a step |
/api/tmux/session |
POST | Create tmux session + launch Claude Code |
/api/tmux/send |
POST | Send keystrokes to tmux session |
/api/tmux/confirm |
POST | Send confirmation (yes/no/enter/escape) |
/api/tmux/capture |
POST | Capture tmux pane content |
/api/tmux/kill |
POST | Kill a tmux session |
/api/tmux/resume |
POST | Resume or re-create a tmux session |
/api/tmux/window |
POST | Create new window in a session |
/api/tmux/live/{session} |
GET | Get live terminal content |
/api/claude/sessions |
GET | List Claude Code sessions for a project |
/api/fs/list |
GET | Browse directories (path picker) |
Managing Multiple Projects
- Click "+ New" in the dashboard or call
/api/projectsto create a project - The system auto-creates a tmux session and launches Claude Code
- Send commands to specific project agents via the terminal panel or API
- Each project runs independently without interference
- The dashboard left sidebar shows all projects — click to switch
Configuration
Optional environment variables:
OPSPILOT_PORT: Web server port (default: 5016)OPSPILOT_PROJECTS_DIR: Default project directory (default: ~/Documents/Projects)