Skip to content

Commit fe83d1b

Browse files
Nodenesterclaude
andcommitted
Initial release — AI agents in containers
- Web dashboard (Next.js 15, Tailwind 4) with GitHub OAuth - Completely different mobile vs desktop layouts - Agent containers: Ubuntu + Claude Code + Chromium + noVNC - Auth container: subscription-based, syncs access token only - Desktop control MCP (17 tools: screenshots, mouse, keyboard, clipboard) - Playwright MCP for browser automation - mem0 per-agent memory + FalkorDB for Graphiti graph memory - GitHub integration: auto-install workflow + webhook per repo - Cron jobs, @AgentBox mentions, issue/PR triggers - Auth terminal accessible from web dashboard - Geist Mono dark theme, film grain, staggered animations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 parents  commit fe83d1b

45 files changed

Lines changed: 3851 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: AgentBox Trigger
2+
3+
on:
4+
# Auto-trigger on issues
5+
issues:
6+
types: [opened, labeled]
7+
8+
# Auto-trigger on PRs
9+
pull_request:
10+
types: [opened, synchronize]
11+
12+
# Auto-trigger on pushes to main
13+
push:
14+
branches: [main, master]
15+
16+
# Trigger when someone @mentions agentbox in a comment
17+
issue_comment:
18+
types: [created]
19+
20+
# Manual trigger with custom prompt
21+
workflow_dispatch:
22+
inputs:
23+
prompt:
24+
description: "What should the agent do?"
25+
required: true
26+
type: string
27+
28+
jobs:
29+
trigger-agent:
30+
runs-on: ubuntu-latest
31+
32+
# Only trigger on comments that mention @agentbox
33+
if: >
34+
github.event_name != 'issue_comment' ||
35+
contains(github.event.comment.body, '@agentbox')
36+
37+
steps:
38+
- name: Trigger AgentBox
39+
run: |
40+
# Send the full GitHub event payload to AgentBox webhook
41+
curl -s -X POST "${{ secrets.AGENTBOX_URL }}/api/webhook" \
42+
-H "Content-Type: application/json" \
43+
-H "X-GitHub-Event: ${{ github.event_name }}" \
44+
-d '${{ toJson(github.event) }}' \
45+
| jq .
46+
env:
47+
AGENTBOX_URL: ${{ secrets.AGENTBOX_URL }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
.next/
3+
.env
4+
*.log
5+
dist/
6+
.DS_Store
7+
Thumbs.db

README.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
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

auth/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM ubuntu:24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV TERM=xterm-256color
5+
6+
# Node.js + basic tools
7+
RUN apt-get update && apt-get install -y \
8+
curl jq netcat-openbsd \
9+
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
10+
&& apt-get install -y nodejs \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# Claude Code
14+
RUN npm install -g @anthropic-ai/claude-code
15+
16+
RUN mkdir -p /root/.claude /claude-auth
17+
18+
COPY sync.sh /sync.sh
19+
RUN chmod +x /sync.sh
20+
21+
EXPOSE 9090
22+
23+
# Keep stdin open for interactive `claude login`
24+
# Usage: docker exec -it agentbox-auth claude login
25+
CMD ["/sync.sh"]

0 commit comments

Comments
 (0)