|
| 1 | +# AgentBox |
| 2 | + |
| 3 | +AI agents in containers. Chat with them, watch them work, trigger them from GitHub. |
| 4 | + |
| 5 | +<p align="center"> |
| 6 | + <img src="docs/login-desktop.png" alt="AgentBox Login — Desktop" width="600" /> |
| 7 | +</p> |
| 8 | + |
| 9 | +<p align="center"> |
| 10 | + <img src="docs/login-mobile.png" alt="AgentBox Login — Mobile" width="200" /> |
| 11 | +</p> |
| 12 | + |
| 13 | +``` |
| 14 | +┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ |
| 15 | +│ Auth │────────▶│ Shared Token │◀────────│ Agent Containers │ |
| 16 | +│ Container │ sync │ (volume) │ r/o │ │ |
| 17 | +│ │ └──────────────┘ │ Ubuntu 24.04 │ |
| 18 | +│ You log in │ │ Claude Code │ |
| 19 | +│ once here │ │ Chromium │ |
| 20 | +└─────────────┘ │ Desktop (noVNC) │ |
| 21 | + │ Playwright │ |
| 22 | + ┌──────────────┐ │ mem0 memory │ |
| 23 | + │ Web UI │──────────────│ Desktop Control │ |
| 24 | + │ :3333 │ manages via └──────────────────┘ |
| 25 | + │ │ Docker API |
| 26 | + │ GitHub OAuth│ |
| 27 | + └──────┬───────┘ |
| 28 | + │ |
| 29 | + ┌──────┴───────┐ |
| 30 | + │ FalkorDB │ |
| 31 | + │ Graph Memory│ |
| 32 | + └──────────────┘ |
| 33 | +``` |
| 34 | + |
| 35 | +## What is this |
| 36 | + |
| 37 | +A simple platform to run persistent AI coding agents in Docker containers. Each agent gets: |
| 38 | + |
| 39 | +- **Full Ubuntu desktop** you can watch via noVNC |
| 40 | +- **Claude Code** with your subscription auth (no API key needed) |
| 41 | +- **Browser automation** via Playwright MCP |
| 42 | +- **Desktop control** — screenshots, mouse, keyboard, clipboard (17 MCP tools) |
| 43 | +- **Persistent memory** — mem0 (per-agent) + FalkorDB (graph memory) |
| 44 | +- **GitHub triggers** — issues, PRs, pushes, `@agentbox` mentions |
| 45 | + |
| 46 | +## Features |
| 47 | + |
| 48 | +**Web Dashboard** — mobile-first, responsive |
| 49 | +- Mobile: native app feel with bottom tab navigation |
| 50 | +- Desktop: sidebar + split pane layout |
| 51 | +- Auth terminal built-in — log into Claude from the browser |
| 52 | + |
| 53 | +**Three views per agent:** |
| 54 | +- **Chat** — talk to Claude Code, streaming responses |
| 55 | +- **Terminal** — full bash shell via xterm.js |
| 56 | +- **Desktop** — watch the agent's screen via noVNC |
| 57 | + |
| 58 | +**Triggers:** |
| 59 | +- GitHub webhooks (auto-installed per repo) |
| 60 | +- GitHub Actions workflow (auto-pushed to repos) |
| 61 | +- Cron jobs (configurable from dashboard) |
| 62 | +- Manual chat |
| 63 | + |
| 64 | +**Auth:** |
| 65 | +- One auth container holds your Claude subscription credentials |
| 66 | +- Only the access token is shared to agents (no refresh token) |
| 67 | +- Token refresh happens automatically in the auth container |
| 68 | +- All agents share the same subscription |
| 69 | + |
| 70 | +## Quick Start |
| 71 | + |
| 72 | +```bash |
| 73 | +# Clone |
| 74 | +git clone https://github.com/NodeNestor/AgentBox.git |
| 75 | +cd AgentBox |
| 76 | + |
| 77 | +# Configure |
| 78 | +cp web/.env.example .env |
| 79 | +# Edit .env with your GitHub OAuth App credentials |
| 80 | + |
| 81 | +# Build and run |
| 82 | +docker compose up -d |
| 83 | + |
| 84 | +# Log into Claude (one time) |
| 85 | +docker exec -it agentbox-auth claude login |
| 86 | + |
| 87 | +# Open dashboard |
| 88 | +open http://localhost:3333 |
| 89 | +``` |
| 90 | + |
| 91 | +## Setup |
| 92 | + |
| 93 | +### 1. GitHub OAuth App |
| 94 | + |
| 95 | +Create a GitHub OAuth App at `github.com/settings/developers`: |
| 96 | +- **Homepage URL**: `http://localhost:3333` |
| 97 | +- **Callback URL**: `http://localhost:3333/api/auth/callback/github` |
| 98 | + |
| 99 | +Add the credentials to `.env`: |
| 100 | +``` |
| 101 | +GITHUB_ID=your_client_id |
| 102 | +GITHUB_SECRET=your_client_secret |
| 103 | +``` |
| 104 | + |
| 105 | +### 2. Org restriction (optional) |
| 106 | + |
| 107 | +To limit access to a specific GitHub org: |
| 108 | +``` |
| 109 | +ALLOWED_ORG=your-org-name |
| 110 | +GITHUB_TOKEN=ghp_xxx # needs read:org scope |
| 111 | +``` |
| 112 | + |
| 113 | +### 3. Claude Auth |
| 114 | + |
| 115 | +The auth container manages your Claude subscription: |
| 116 | + |
| 117 | +```bash |
| 118 | +docker exec -it agentbox-auth claude login |
| 119 | +``` |
| 120 | + |
| 121 | +Or use the **Auth** tab in the web dashboard. |
| 122 | + |
| 123 | +The auth container: |
| 124 | +- Holds the full credentials (including refresh token) |
| 125 | +- Only shares the access token with agent containers |
| 126 | +- Auto-refreshes tokens before expiry |
| 127 | +- Syncs every 15 seconds |
| 128 | + |
| 129 | +### 4. Connect repos |
| 130 | + |
| 131 | +Click **Connect** on any repo in the dashboard. AgentBox automatically: |
| 132 | +1. Pushes `.github/workflows/agentbox.yml` to the repo |
| 133 | +2. Creates a webhook pointing to your AgentBox instance |
| 134 | + |
| 135 | +Mention `@agentbox` in any issue or PR comment to trigger an agent. |
| 136 | + |
| 137 | +## Architecture |
| 138 | + |
| 139 | +``` |
| 140 | +docker-compose.yml |
| 141 | +├── auth — Claude subscription auth + token sync |
| 142 | +├── web — Next.js dashboard + auth terminal WebSocket |
| 143 | +├── falkordb — Graph memory database (Graphiti backend) |
| 144 | +└── agent-template — Builds the agent container image |
| 145 | +
|
| 146 | +Agent containers are created dynamically from the dashboard. |
| 147 | +Each agent gets: |
| 148 | +├── /root/.claude-auth — Read-only access token from auth container |
| 149 | +├── /root/.claude-local — Writable Claude config + MCP settings |
| 150 | +├── /agent-memory — Persistent mem0 storage (named volume) |
| 151 | +├── /workspace — Working directory |
| 152 | +└── MCP servers: |
| 153 | + ├── desktop-control — xdotool/scrot/xclip (17 tools) |
| 154 | + └── playwright — Browser automation |
| 155 | +``` |
| 156 | + |
| 157 | +## Stack |
| 158 | + |
| 159 | +| Layer | Tech | |
| 160 | +|-------|------| |
| 161 | +| Web | Next.js 15, React 19, Tailwind 4 | |
| 162 | +| Auth | NextAuth v5, GitHub OAuth | |
| 163 | +| Container mgmt | Dockerode, Docker socket | |
| 164 | +| Terminal | xterm.js, WebSocket, node-pty | |
| 165 | +| Desktop | Xvfb, x11vnc, noVNC, Openbox | |
| 166 | +| Browser | Chromium, Playwright MCP | |
| 167 | +| Desktop control | xdotool, scrot, xclip, wmctrl | |
| 168 | +| Memory | mem0 (SQLite), FalkorDB (graph) | |
| 169 | +| Agent | Claude Code (subscription auth) | |
| 170 | + |
| 171 | +## Ports |
| 172 | + |
| 173 | +| Port | Service | |
| 174 | +|------|---------| |
| 175 | +| 3333 | Web dashboard | |
| 176 | +| 3334 | Auth terminal WebSocket | |
| 177 | +| 9090 | Auth container health API | |
| 178 | +| 6379 | FalkorDB | |
| 179 | + |
| 180 | +Agent containers get random ports assigned for VNC (5900), noVNC (6080), and API (8080). |
| 181 | + |
| 182 | +## Design |
| 183 | + |
| 184 | +Dark theme, monospace everything (Geist Mono). Two completely different layouts: |
| 185 | + |
| 186 | +**Mobile** — native app feel |
| 187 | +- Bottom tab bar (Agents / Repos / Cron / Auth) |
| 188 | +- Full-screen views per tab |
| 189 | +- Slide-up animations, backdrop blur nav |
| 190 | +- Safe area support (notch phones) |
| 191 | + |
| 192 | +**Desktop** — workstation feel |
| 193 | +- Left sidebar with agent list |
| 194 | +- Split pane agent view (chat left, terminal/desktop right) |
| 195 | +- Collapsible auth terminal in sidebar |
| 196 | +- Staggered fade-in animations |
| 197 | + |
| 198 | +## License |
| 199 | + |
| 200 | +MIT |
0 commit comments