Warning
AgentCo is alpha software under heavy development.
Warning
Requires patched version of OpenCode while issues #10564 and #11225 are open
Self-hosted orchestration system for managing multiple OpenCode coding agents working on tasks across multiple projects simultaneously. Automates the complete task lifecycle from git branch management through PR submission.
- TUI and CLI for managing a fleet of OpenCode agents, organized by project
- Automatic git worktree and branch management
- Plan mode with approval workflow before build execution
- Attach to any running agent in a new tmux pane
- Real-time OS notifications
- Automatic PR submission via GitHub CLI
- Dev server management and database provisioning per task
- Automatic test environments per PR
- Automatic task decomposition
- Web UI
- Linear integration
- OpenClaw integration
AgentCo is a monorepo with three packages:
- orchestrator - HonoJS backend that manages projects, tasks, git worktrees, OpenCode processes, dev servers, and database provisioning
- tui - Terminal UI built with Solid.js and OpenTUI for monitoring and managing tasks
- cli - Command-line interface for scripting and quick operations
CLI / TUI
│
│ HTTP + WebSocket
▼
Orchestrator (port 8080)
│
├── Git worktree per task
├── OpenCode agent per task
├── Dev server per task
└── SQLite database (~/.agentco/agentco.db)
pending → setting_up → agent_running → agent_done → pr_created → merged → archived
↕ ↕
needs_input plan_ready
↓
preview_live
Any state can transition to → failed or aborted
- Bun
- OpenCode
- tmux (for
task attach) - git
- GitHub CLI (
gh) (for PR creation)
# Install dependencies
bun install
# Build all packages
bun run build
# Push database schema
cd packages/orchestrator && bun run db:push && cd ../..
# Start the orchestrator and TUI
bun run dev# Projects
agentco project create <name> --path /path/to/repo
agentco project list
# Tasks
agentco task create <project> [description] --file <path>
agentco task list [--project <name>]
agentco task attach <taskId> # Open OpenCode TUI in tmux pane
agentco task kill <taskId> # Abort, clean up, and delete
# TUI
agentco tuiTip:
bun run cliat the repo root is a shortcut foragentco.
Each managed project can include an .agentco.json in its root:
{
"copyOnWorktree": [".env", "credentials/"],
"envOverrides": { "PORT": "auto", "DATABASE_URL": "auto" },
"database": {
"type": "postgres",
"connectionString": "postgresql://...",
"migrateCommand": "npm run migrate",
"seedCommand": "npm run seed"
},
"devPreview": {
"command": "npm run dev",
"portEnvVar": "PORT",
"healthCheck": "/api/health",
"readyPattern": "listening"
},
"agent": {
"defaultModel": "anthropic/claude-opus-4-6"
}
}# Run orchestrator + TUI in dev mode (with watch)
bun run dev
# Type checking
bun run typecheck
# Database management
cd packages/orchestrator
bun run db:push # Apply schema changes
bun run db:generate # Generate migrations
bun run db:migrate # Run migrations
bun run db:studio # Open Drizzle Studio