██████╗ ██████╗ ███████╗███╗ ██╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║
██║ ██║██████╔╝█████╗ ██╔██╗ ██║
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║
╚██████╔╝██║ ███████╗██║ ╚████║
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝
██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗██████╗
██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝██╔══██╗
██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║█████╗ ██████╔╝
██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║██╔══╝ ██╔══██╗
╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████╗██║ ██║
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝╚═╝ ╚═╝
┌─────────────────────────────────────────────────────────────┐
│ 🤖 Delegate tasks to AI agents in isolated containers 🐳 │
└─────────────────────────────────────────────────────────────┘
Delegate tasks to AI coding agents with full isolation and control.
Open Commander is a self-hosted platform that lets you delegate coding tasks to AI agents (Claude, OpenAI Codex, Cursor, and more) running in isolated Docker containers. Each agent gets its own secure environment with controlled internet access, making it safe to let AI work on your codebase autonomously.
- Isolated Execution: Each agent runs in its own Docker container with no direct access to your host system
- Controlled Egress: Outbound internet access goes through a proxy with configurable allowlists
- No Credential Leaks: API keys and tokens stay on the server, never exposed to agents
- Fire and Forget: Submit a task via API and let the agent work independently
- Automatic Repository Cloning: Just provide
owner/repo— the system clones it automatically - Progress Tracking: Monitor task status, view logs, and get results via API or web UI
- Choose Your Agent: Claude, OpenAI Codex, Cursor, or custom agents
- Consistent Interface: Same API for all agents
- Agent-Specific Configurations: Customize settings per agent type
- REST API: Create tasks, check status, and retrieve results programmatically
- GitHub Integration: Verify repository access before delegating tasks
- Webhooks Ready: Integrate with CI/CD pipelines and automation tools
- Your Infrastructure: Run on your own servers or cloud
- Your Data: Code never leaves your environment
- Your Rules: Full control over access, quotas, and permissions
- Docker and Docker Compose
- Bun (for local development)
- A GitHub Personal Access Token (for cloning private repositories)
git clone https://github.com/your-org/open-commander.git
cd open-commanderStart the required services (PostgreSQL, Redis, Docker-in-Docker, Egress Proxy):
docker compose up -dThis starts:
- PostgreSQL (port 5432) — Database for tasks, users, and settings
- Redis (port 6379) — Job queue for task execution
- Docker-in-Docker — Isolated Docker daemon for running agent containers
- Egress Proxy (port 3128) — Controlled outbound internet access
- Worker Jobs — Background worker for processing task executions
- Worker Board (port 4000) — Bull Board UI for monitoring job queues
# Copy the example environment file
cp apps/web/.env.example apps/web/.envEdit apps/web/.env and configure the required variables:
# Required: Path to your Open Commander installation
COMMANDER_BASE_PATH=/path/to/open-commander
# Required: Directory where repositories will be cloned
# Agent containers will have access to this directory
AGENT_WORKSPACE=/path/to/your/projects
# Required: Your GitHub token for cloning repositories
# Create at: https://github.com/settings/tokens
# Recommended scopes: repo (for private repos)
GITHUB_TOKEN=ghp_your_token_here
# Database (matches docker-compose defaults)
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/commander_dev
# App URL
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Disable auth for local development (never in production!)
NEXT_PUBLIC_DISABLE_AUTH=true# Install dependencies
bun install
# Generate Prisma client and run migrations
cd apps/web
bunx prisma generate
bunx prisma migrate deploy# From the apps/web directory
bun run devThe application will be available at http://localhost:3000.
| Variable | Description |
|---|---|
COMMANDER_BASE_PATH |
Absolute path to the Open Commander installation |
AGENT_WORKSPACE |
Directory where repositories are cloned and mounted into containers |
DATABASE_URL |
PostgreSQL connection string |
GITHUB_TOKEN |
GitHub PAT for cloning repositories and API access |
For production, configure at least one OAuth provider:
# GitHub OAuth
NEXT_PUBLIC_GITHUB_AUTH_ENABLED=true
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
# Google OAuth
NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secretThese have sensible defaults but can be customized:
# Agent container image
TTYD_IMAGE=opencommander/agent:latest
# Docker networks (must match docker-compose.yml)
TTYD_INTERNAL_NETWORK=open-commander_open-commander-internal
TTYD_INGRESS_NETWORK=open-commander_open-commander-ingress
# Egress proxy settings
TTYD_EGRESS_PROXY_HOST=egress-proxy
TTYD_EGRESS_PROXY_PORT=3128See apps/web/.env.example for the complete list of configuration options.
- Open the web UI at http://localhost:3000
- Go to Settings → API Clients
- Create a new API client and generate a secret key
- Save the key securely — it's only shown once!
The Bull Board UI is available at http://localhost:4000/admin/queues for monitoring and managing background jobs.
curl -X POST http://localhost:3000/api/tasks \
-H "Authorization: Bearer oc_sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"body": "Fix the bug in src/utils/auth.ts where tokens expire too early",
"agentId": "claude",
"repository": "your-org/your-repo"
}'The repository is automatically cloned — the agent starts with it as the working directory. No need to include clone instructions in the task.
# Get task by ID
curl http://localhost:3000/api/tasks/clx789abc123 \
-H "Authorization: Bearer oc_sk_your_api_key"
# List all tasks
curl http://localhost:3000/api/tasks \
-H "Authorization: Bearer oc_sk_your_api_key"Before delegating a task, you can verify the server has access to the repository:
curl -X POST http://localhost:3000/api/github/verify-access \
-H "Content-Type: application/json" \
-d '{"repository": "your-org/your-repo"}'┌─────────────────────────────────────────────────────────────────┐
│ Open Commander │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Web UI │ │ REST API │ │ Job Queue │ │
│ │ (Next.js) │ │ (tRPC) │ │ (BullMQ) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ │ │
│ ┌─────▼─────┐ │
│ │ PostgreSQL │ │
│ └───────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Docker-in-Docker │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Agent 1 │ │ Agent 2 │ │ Agent N │ │
│ │ (Claude) │ │ (Codex) │ │ (...) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ │ │
│ ┌─────▼─────┐ │
│ │Egress Proxy│───────► Internet (filtered) │
│ └───────────┘ │
└─────────────────────────────────────────────────────────────────┘
Full API documentation is available at apps/web/public/skill.md or via the web UI.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/tasks |
List tasks |
POST |
/api/tasks |
Create a new task |
GET |
/api/tasks/:id |
Get task details |
POST |
/api/github/verify-access |
Verify repository access |
open-commander/
├── apps/
│ └── web/ # Next.js application
│ ├── src/
│ │ ├── app/ # Next.js app router
│ │ ├── components/ # React components
│ │ ├── lib/ # Core services (docker, git)
│ │ └── server/ # tRPC routers & job workers
│ └── prisma/ # Database schema
├── docker/
│ ├── agent/ # Agent container Dockerfile
│ └── egress/ # Egress proxy configuration
└── docker-compose.yml # Infrastructure services
bun testcd apps/web
bun run buildAll images use the repo root as the Docker build context.
Commander (web app)
docker build \
-f docker/commander/Dockerfile \
--target runner \
-t ghcr.io/open-commander/open-commander-web:local \
.Egress proxy
docker build \
-f docker/egress/Dockerfile \
-t ghcr.io/open-commander/open-commander-egress:local \
docker/egressAgent core image
docker build \
-f docker/core/Dockerfile \
-t ghcr.io/open-commander/open-commander-core:local \
docker/coreAgent image (requires core to be built first)
docker build \
-f docker/agent/Dockerfile \
-t ghcr.io/open-commander/open-commander-agent:local \
docker/agentMulti-platform builds (amd64 + arm64)
docker buildx create --use --name multi-platform
docker buildx build \
--platform linux/amd64,linux/arm64 \
-f docker/commander/Dockerfile \
--target runner \
-t ghcr.io/open-commander/open-commander-web:local \
--load \
.Testing the deploy stack with local images
Build the deploy images, tag them to match what the compose file expects, then run:
docker build -f docker/commander/Dockerfile --target runner -t ghcr.io/open-commander/open-commander-web:latest .
docker build -f docker/egress/Dockerfile -t ghcr.io/open-commander/open-commander-egress:latest docker/egress
cp .env.deploy.example .env.deploy # fill in values
docker compose -f docker-compose.deploy.yml -f docker-compose.dbs.yml --env-file .env.deploy up -d- Never expose the API without authentication in production
- Review egress allowlists in
docker/egress/allowed-domains.txt - Rotate GitHub tokens regularly
- Use environment-specific secrets — don't commit
.envfiles - Monitor agent activities through logs and the web UI
MIT License — see LICENSE for details.
Contributions are welcome! Please read our contributing guidelines before submitting PRs.