8000 GitHub - t18n/sandbox-web-dev: A Docker sandbox template with batteries-included dev tooling and plug-and-play kits for AI coding agents. · GitHub
[go: up one dir, main page]

Skip to content

About

A Docker sandbox template with batteries-included dev tooling and plug-and-play kits for AI coding agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

web-dev-sandbox

A Docker sandbox template that provides a complete web development environment, paired with kits that layer on specific AI coding agents.

Pick a template. Pick a kit. Start coding.


Architecture

Template (Dockerfile)                    Kits (kits/<name>/spec.yaml)
┌──────────────────────────┐            ┌─────────────────────────┐
│  shell-docker base       │            │  claude-code            │
│  + system packages       │     ◄──    │  gemini                 │
│  + mise (Node, Python)   │  image     │  codex                  │
│  + TypeScript, Playwright│  reference │  opencode               │
│  + ESLint, Prettier      │            │  cursor-agent           │
│  + database CLIs         │            │  kiro / copilot         │
│  + Docker CE             │            │  droid / amp            │
└──────────────────────────┘            └─────────────────────────┘

The template is the development environment — runtimes, compilers, linters, formatters, test runners, database CLIs, and Docker. It gets published as a container image.

Kits are lightweight YAML specs that reference the template image, install a specific agent at sandbox launch, configure network access and credential injection, and prime the agent with context about the environment.


What's in the template

Runtimes — managed by mise

Runtime Default Switch with
Node.js 24 mise use node@22
Python 3.12 mise use python@3.11
Bun latest mise use bun@1.1

Package managers

npm · pnpm · yarn · bun · pip

TypeScript toolchain

typescript (tsc) · tsx · ts-node

Linting and formatting

eslint · prettier · biome

Testing

playwright (CLI + Chromium & headless shell) · puppeteer (Chrome & headless shell) · vitest

Python tools

ruff · mypy · httpie

System tools

Category Tools
Database CLIs psql, redis-cli, sqlite3
Docker CE + Compose + Buildx
Build gcc, g++, make, cmake, build-essential
Git git, git-lfs, gh
Shell bat, fzf, jq, yq, ripgrep

Network access — all kits

Every kit allows outbound access to a shared set of documentation and package registries so agents can look up docs and check packages without leaving the sandbox:

Domain Purpose
developer.mozilla.org MDN Web Docs
nodejs.org Node.js docs
docs.python.org Python docs
jsr.io JSR package registry
pypi.org PyPI package search
context7.com Context7 (library docs)
mcp.context7.com Context7 MCP endpoint
registry.npmjs.org npm registry
github.com GitHub

Each kit also allows its own agent API endpoint(s). See kits/<name>/spec.yaml for per-kit rules.


Available kits

Kit Agent Run with
claude-code Claude Code (Anthropic) sbx run --kit ./kits/claude-code/ claude-code
gemini Gemini CLI (Google) sbx run --kit ./kits/gemini/ gemini
codex Codex (OpenAI) sbx run --kit ./kits/codex/ codex
opencode OpenCode sbx run --kit ./kits/opencode/ opencode
cursor-agent Cursor Agent sbx run --kit ./kits/cursor-agent/ cursor-agent
kiro Kiro (AWS) sbx run --kit ./kits/kiro/ kiro
copilot GitHub Copilot sbx run --kit ./kits/copilot/ copilot
droid Droid (Factory AI) sbx run --kit ./kits/droid/ droid
amp Amp sbx run --kit ./kits/amp/ amp

Quick start

Prerequisites

  • Docker Desktop with the sbx CLI
  • A GitHub account (for GHCR image hosting)

1. Build and push the template

git clone https://github.com/t18n/sandbox-web-dev
cd sandbox-web-dev

DOCKER_REGISTRY=ghcr.io/t18n just push

2. Update kit image references

Replace ghcr.io/OWNER/web-dev-sandbox:latest in each kit's spec.yaml with your published image:

sed -i '' 's|ghcr.io/OWNER/|ghcr.io/t18n/|g' kits/*/spec.yaml

3. Register API keys

Each kit needs its agent's API key. Use sbx secret to register credentials on the host — they never enter the sandbox.

# Claude Code
sbx secret set-custom -g \
    --host api.anthropic.com \
    --env ANTHROPIC_API_KEY \
    --placeholder "sk-ant-{rand}" \
    --value "$ANTHROPIC_API_KEY"

# Codex / OpenAI
sbx secret set-custom -g \
    --host api.openai.com \
    --env OPENAI_API_KEY \
    --placeholder "sk-{rand}" \
    --value "$OPENAI_API_KEY"

# Gemini
sbx secret set-custom -g \
    --host generativelanguage.googleapis.com \
    --env GEMINI_API_KEY \
    --placeholder "AIza{rand}" \
    --value "$GEMINI_API_KEY"

4. Launch a sandbox with a kit

# Claude Code
sbx run --kit ./kits/claude-code/ claude-code

# Gemini
sbx run --kit ./kits/gemini/ gemini

# Or load a kit straight from GitHub
sbx run claude-code --kit "git+https://github.com/t18n/sandbox-web-dev.git#ref=main&dir=kits/claude-code"
  • #ref=<branch|tag|commit> pins to a specific revision. Defaults to the repository's default branch.
  • #dir=<path> loads a kit from a subdirectory.
  • git+ssh:// URLs also work, using your local SSH agent, Git credential helpers, and .netrc.
  • Quote the URL in shells where & starts a background job.

Development

just is the task runner. Install with brew install just.

just build              # build template image locally
just push               # build and push to registry
just run                # drop into a shell in the template image
just kit claude-code    # launch a sandbox with the Claude Code kit
just validate-kit codex # validate a kit spec

Override the registry:

DOCKER_REGISTRY=ghcr.io/t18n just push

CI/CD

The GitHub Actions workflow (.github/workflows/build.yml) builds and pushes the template image to ghcr.io on every push to main, plus a weekly scheduled run.

Setup:

  1. Fork the repo
  2. Ensure Settings → Actions → General has "Read and write permissions" for GITHUB_TOKEN
  3. Push to main

The template image publishes to ghcr.io/t18n/web-dev-sandbox:latest.


Creating a new kit

  1. Create kits/<name>/spec.yaml following the kit spec reference
  2. Set sandbox.image to your published template image
  3. Add install commands, network rules, and agent context
  4. Validate: just validate-kit <name>
  5. Test: just kit <name>

See existing kits in kits/ for examples.


License

MIT

About

A Docker sandbox template with batteries-included dev tooling and plug-and-play kits for AI coding agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0