agentbox

module
v0.0.0-...-4686852 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT

README

Agentbox

Docker-sandboxed AI coding agent CLI with Ralph loop support.

Features

  • Isolated Execution: Run AI coding agents (Claude Code, Amp, Aider) in Docker containers
  • Ralph Pattern: Iterative task completion with persistent state across iterations
  • Multi-Agent Support: Plugin architecture for different AI agents
  • Security First: Network isolation by default, controlled API access

Prerequisites

  • Docker — must be installed and running
  • Go 1.24.0+ — required to build from source
  • API keys — see Environment Variables for your agent

Installation

# From source
go install github.com/swamp-dev/agentbox/cmd/agentbox@latest

# Or build locally
git clone https://github.com/swamp-dev/agentbox.git
cd agentbox
make build

Quick Start

# Build Docker images (first time only)
make docker-build-full

# Initialize a project
agentbox init

# Run a single agent session
agentbox run --agent claude-cli --project . --prompt "Fix the bug in auth.ts"

# Run Ralph loop until PRD complete
agentbox ralph --agent claude-cli --max-iterations 10 --prd prd.json

# Check progress
agentbox status
agentbox status --tasks          # show individual task list
agentbox dashboard --watch       # live-refresh TUI
MCP Integration (Claude Code)

Add to your Claude Code MCP config to use agentbox as tools:

agentbox mcp start

Then Claude Code can call agentbox_ralph_start, agentbox_run, etc. Use the returned wait_command with Bash run_in_background to get notified on completion without polling.

Commands

Command Description
run Single agent session in container
ralph Run Ralph loop until PRD complete
sprint Run autonomous multi-sprint development
init Initialize project with templates
status Show Ralph loop progress (--tasks for task list)
dashboard Show sprint progress and metrics (--watch for live TUI)
wait Block until async session completes (for automation)
journal View dev diary entries
retro View sprint retrospective reports
images Manage base Docker images
mcp Start MCP server for Claude Code integration
version Print version information

See docs/cli-reference.md for complete flag reference.

Configuration

Create agentbox.yaml in your project root:

version: "1.0"
project:
  name: "my-project"

agent:
  name: claude  # claude, claude-cli, amp, aider

docker:
  image: full   # node, python, go, rust, full
  resources:
    memory: "4g"
    cpus: "2"
  network: none  # isolated by default

ralph:
  max_iterations: 10
  prd_file: prd.json
  progress_file: progress.txt
  auto_commit: true
  quality_checks:
    - name: typecheck
      command: npm run typecheck
    - name: test
      command: npm test
  stop_signal: "<promise>COMPLETE</promise>"

Ralph Pattern

See docs/prd-guide.md for the PRD schema reference and guide for writing effective PRDs.

The Ralph pattern enables iterative AI agent execution with memory persistence:

  1. Spawn fresh container with agent
  2. Load PRD, find next incomplete task
  3. Run agent with task-specific prompt
  4. Check for completion signal
  5. Run quality checks
  6. Commit changes to git
  7. Update prd.json
  8. Append learnings to progress.txt
  9. Repeat until complete

State persists via:

  • Git history (code changes)
  • prd.json (task status)
  • progress.txt (learnings)
  • AGENTS.md (patterns discovered)

Docker Images

Image Contents
agentbox/node:20 Node.js 20, npm, pnpm, Claude Code
agentbox/python:3.12 Python 3.12, pip, poetry, uv
agentbox/go:1.24 Go 1.24, common tools
agentbox/rust:1.77 Rust, cargo
agentbox/full:latest All languages + all agents

Build images locally:

make docker-build

Security

Isolated by default:

  • Filesystem: Only mounted /workspace accessible
  • Network: No outbound (opt-in with --allow-network)
  • Processes: Container PID namespace
  • Docker: No access to host docker.sock

Shared (read-only):

  • SSH keys (~/.ssh)
  • Git config (~/.gitconfig)
  • API keys (via environment)

Environment Variables

Variable Agent Required
ANTHROPIC_API_KEY claude, aider Yes for claude
OPENAI_API_KEY aider Alternative for aider
AMP_API_KEY amp Yes for amp
(none) claude-cli Uses Claude subscription auth (~/.claude/). Run claude login first.

Development

# Run tests
make test

# Build binary
make build

# Format code
make fmt

# Run linters
make lint

Documentation

License

MIT

Directories

Path Synopsis
cmd
agentbox command
Agentbox is a CLI tool for running Docker-sandboxed AI coding agents.
Agentbox is a CLI tool for running Docker-sandboxed AI coding agents.
internal
agent
Package agent provides adapters for different AI coding agents.
Package agent provides adapters for different AI coding agents.
cli
Package cli provides the command-line interface for agentbox.
Package cli provides the command-line interface for agentbox.
config
Package config handles agentbox configuration parsing and validation.
Package config handles agentbox configuration parsing and validation.
container
Package container provides Docker container management for agentbox.
Package container provides Docker container management for agentbox.
journal
Package journal provides dev diary functionality for agentbox sessions.
Package journal provides dev diary functionality for agentbox sessions.
mcp
Package mcp implements an MCP (Model Context Protocol) server for agentbox.
Package mcp implements an MCP (Model Context Protocol) server for agentbox.
metrics
Package metrics provides quality trend tracking, resource monitoring, and budget enforcement.
Package metrics provides quality trend tracking, resource monitoring, and budget enforcement.
proxy
Package proxy provides an HTTP CONNECT proxy that restricts egress to allowlisted hosts.
Package proxy provides an HTTP CONNECT proxy that restricts egress to allowlisted hosts.
ralph
Package ralph implements the Ralph pattern for iterative AI agent execution.
Package ralph implements the Ralph pattern for iterative AI agent execution.
retro
Package retro provides sprint retrospective analysis and pattern detection.
Package retro provides sprint retrospective analysis and pattern detection.
review
Package review provides code review orchestration via a separate agent.
Package review provides code review orchestration via a separate agent.
store
Package store provides SQLite-based persistence for agentbox runtime data.
Package store provides SQLite-based persistence for agentbox runtime data.
supervisor
Package supervisor provides the meta-orchestrator for the full development lifecycle.
Package supervisor provides the meta-orchestrator for the full development lifecycle.
taskdb
Package taskdb provides rich task management with DAG-based dependency tracking.
Package taskdb provides rich task management with DAG-based dependency tracking.
wizard
Package wizard provides environment detection and interactive setup for agentbox projects.
Package wizard provides environment detection and interactive setup for agentbox projects.
workflow
Package workflow provides git workflow automation for agentbox.
Package workflow provides git workflow automation for agentbox.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL