Prerequisites
devsandboxes drives a container runtime directly: no devcontainer CLI, no daemon to set up (its own starts on demand). You need:
- A running docker, podman or Apple
container(macOS). The default iscontaineron macOS anddockerelsewhere; pick another withDEVSANDBOX_RUNTIME=docker|podman|container. git, for the worktrees extra instances get.curl, to fetch devcontainer Features.
Install
The package is devsandboxes; the binary it installs is devsandbox.
npm i -g devsandboxes
devsandbox --help
npx devsandboxes --help # without installingNative binaries for Linux x64/arm64, macOS arm64 and Windows x64, plus the typed Node API.
curl -L https://github.com/Nemikolh/devsandboxes/releases/download/v0.8.0/devsandbox-0.8.0-$(uname -m)-unknown-linux-musl.tar.gz | tar xz
sudo mv devsandbox /usr/local/bin/ # or anywhere on your PATHStatic binaries for x86_64 and aarch64.
curl -L https://github.com/Nemikolh/devsandboxes/releases/download/v0.8.0/devsandbox-0.8.0-aarch64-apple-darwin.tar.gz | tar xz
sudo mv devsandbox /usr/local/bin/ # or anywhere on your PATHApple silicon. Works with docker (OrbStack, Docker Desktop) and Apple container.
Invoke-WebRequest https://github.com/Nemikolh/devsandboxes/releases/download/v0.8.0/devsandbox-0.8.0-x86_64-pc-windows-msvc.zip -OutFile devsandbox.zip
Expand-Archive devsandbox.zip .x86_64; put devsandbox.exe on your PATH. Native Windows is untested: the Linux build inside WSL2 is the exercised path.
cargo install devsandboxGive your agent the skills
The repo ships two agent skills:
devsandbox-cli: how to use the CLI.config-toml-spec: the config format.
Install them with skills.sh, or copy them by hand:
npx skills add nemikolh/devsandboxesAsks which agents to install them for: Claude Code, Codex, Cursor and many more. Takes them from the default branch.
git clone --depth 1 --branch v0.8.0 https://github.com/Nemikolh/devsandboxes.git /tmp/ds
mkdir -p ~/.claude/skills
cp -r /tmp/ds/skills/* ~/.claude/skills/ # devsandbox-cli, config-toml-specInto wherever your agent reads skills from; for Claude Code that’s ~/.claude/skills/. The release tag keeps them in step with your binary.
Write a config
A config root is a folder holding one devsandboxes.toml (or devsandboxes.yaml, same schema). It lives outside your repos and describes every sandbox; each sandbox points at a repo with folder, relative to the config root. This guide uses this layout, with web being any git repository:
~/code/
├── sandboxes/
│ └── devsandboxes.toml
└── web/ # your repoWith your agent
Paste this into your agent and let it do the typing:
Create a devsandbox config dir at ~/code/sandboxes with a devsandboxes.toml holding a sandbox for my repo at ~/code/web, plus a postgres service it can use.
- Read the devsandbox-cli and config-toml-spec skills first (load them if they are installed, otherwise read them from https://github.com/Nemikolh/devsandboxes/tree/main/skills). Follow them over your own assumptions: unknown config keys are hard errors.
- Find my devsandbox config dir: the folder holding devsandboxes.toml, passed to devsandbox as
-C <config dir>. If you cannot tell which one, ask me. - Look at ~/code/web to pick the base image, devcontainer Features and
postCreateCommandit needs (package manager, language toolchains); if it has a.devcontainer/devcontainer.json, port that instead. - Put the shared parts (features, caches,
persist-shell-history) in a[template.base]the sandboxextends, and add a[services.database]onpostgres:16withscope = "global", listed in the sandbox'sservices. - Validate with
devsandbox -C <config dir> lsand fix every error it reports before going on. - Run
devsandbox -C <config dir> run <sandbox name>, thendevsandbox -C <config dir> exec <instance> <the repo's test command>, and report what happened. - Ask me before anything destructive: devsandbox rm, gc, rebuild --force, service rebuild, deleting files or branches.
By hand
Put this in ~/code/sandboxes/devsandboxes.toml:
[services.database]
image = "postgres:16"
scope = "global" # one container shared by all instances
[template.base]
caches = ["pnpm"]
persist-shell-history = true
[template.base.features]
"ghcr.io/devcontainers/features/node:1" = { version = "lts" }
[sandbox.web]
extends = "base"
folder = "../web" # the repo, relative to this folder
services = ["database"]
image = "mcr.microsoft.com/devcontainers/base:ubuntu"
postCreateCommand = "pnpm install"[sandbox.web] is a devcontainer definition in TOML: image, features and postCreateCommand mean what they mean in devcontainer.json. It extends the base template, which deep-merges into it (tables recurse, arrays concatenate), so every sandbox extending base shares the pnpm cache and the Node feature. [services.database] is a postgres sidecar; scope = "global" makes every instance share one container instead of getting its own.
Check it from the config root. ls lists the sandboxes and fails loudly on unknown keys:
cd ~/code/sandboxes
devsandbox lsNAME SOURCE FOLDER SERVICES EXTENDS
web image mcr.microsoft.com/devcontainers/base:ubuntu ../web database baseThe dashboard
From the config root, run devsandbox with no arguments to open the dashboard: every instance and service live, with the actions of the CLI one key away.
devsandboxSelect web and press r to run an instance, t for a terminal inside it, ? for every key binding. Run it again and the second instance gets its own git worktree, so two agents never share a working tree. The dashboard tour walks through each tab next to a preview you can play with.
Next steps
Source: site/src/content/docs/quick-start.mdxEdit this page on GitHub(opens in a new tab)