Repository navigation
v0.5.0
Sandboxes can now start themselves after a reboot and run unattended dispatcher scripts that create, drive and clean up their own child instances. Messages from inside containers show up in the dashboard and as desktop notifications. See docs/automations-guide.md. run --json, a command-less exec and exact-name matching make devsandbox easier to drive from scripts and other programs, and the docs now live at devsandboxes.com.
Added
autostart: a sandbox's instances come up once per boot, when the dashboard opens or after your firstdevsandbox run/start. A sandbox with no instance yet gets one; dispatcher children are left to their dispatcher.autostart = "runtime": docker and podman restart the containers themselves at boot (--restart unless-stopped), with no devsandbox process needed. Podman also needspodman-restart.serviceenabled. On Applecontainerit behaves liketrue. Changingautostartnever marks an instance as drifted; the nextstartapplies it in place.
[sandbox.triage]
folder = "../triage"
autostart = "runtime" # or true- Boot hook: new containers run
devsbd booton every start, which brings back the helper daemon and, in runtime mode,postStartCommand(output in/run/devsandbox/boot.log). Containers created before this needdevsandbox rebuild --forceto get it. devsbd notify: any sandbox can send the user a message. It is queued inside the container until a dashboard is open, then shown in the new Inbox tab (unread badges on instance rows,enteropens anhttp(s)link,d/Ddismiss) and as a desktop notification (notify-send/osascript).
devsbd notify --level warn --key pr-123 --link https://github.com/o/r/pull/123 "PR 123 needs you"- Dispatchers: a sandbox that declares
dispatchercan manage child instances throughdevsbd, while the dashboard is open. Children are named<sandbox>-<key>, always get their own worktree, are marked⇠ <dispatcher>in the TUI, and outlive the dispatcher. Host-side operations log to<data>/devsandbox/logs/dispatch-*.log. Exit codes: 75 when no dashboard is connected, 77 when denied.spawn = ["*"]means every sandbox in the config root except other dispatchers, and it grants their mounts, docker socket and privileges. Children can never be dispatchers themselves.max-instancesdefaults to 10 and counts stopped children too.--branchaccepts plain branch names only ([A-Za-z0-9._/-]) and is used literally, with no${…}expansion.--envrefuses names that could take over processes in the child:PATH,HOME,SHELL,LD_*,DYLD_*,GIT_*,NODE_OPTIONS,PYTHON*and similar. Its values are kept across adevsandbox rebuildof the child, including whenensurerecreates a missing container. On an existing child,ensure --envreplaces the saved values, and every command devsandbox runs in the child (exec, dashboard terminals,devsbd execruns, lifecycle commands) uses them from then on, over a same-namedremoteEnv; already-running processes keep the old ones until a rebuild.
[sandbox.pr-dispatcher]
folder = "../pr-dispatcher"
autostart = "runtime"
dispatcher = { spawn = ["web"], max-instances = 10 } # "*" = any non-dispatcher sandbox
postStartCommand = "nohup ./loop.sh >loop.log 2>&1 &"devsbd ensure web --key pr-123 --branch feat/x # create or start web-pr-123
devsbd exec pr-123 --detach -- zidane -p "babysit PR 123"
devsbd run logs pr-123 <id> --follow
devsbd ls; devsbd stop pr-123; devsbd rm pr-123- Runs: commands started with
devsbd execare tracked in the child (id, log, exit status). Follow them withdevsbd run ls|logs|wait, clean them up withdevsbd run rm(--forcekills a running one) anddevsbd run prune --keep N; the TUI shows a child's last runs under its processes. devsbdis onPATHin containers (/usr/local/bin/devsbd).forwardPorts: while the dashboard is open it forwards each running instance's configured ports to127.0.0.1, the same waydevsandbox portdoes (no container restart). Each instance keeps its host ports across dashboard restarts, and a port already taken moves to the next free one up. A global service's port is forwarded once, however many instances list it. In the Ports tab these rows are marked(config);dstops one until the dashboard reopens.
[sandbox.api]
services = ["db"]
# 3000, "db:5432" as in devcontainer.json; "8080:3000" / "15432:db:5432" pick the host port
forwardPorts = [3000, "8080:3000", "db:5432"]run --json: prints one{"schema": 1, "data": {...}}document for the new instance (name,instance_id,sandbox,container,workspace,folder,base_folder,worktree,branch; the last twonullwithout a worktree). Everything child processes print (image builds,docker run, git, lifecycle hooks, autostart) goes to stderr, so stdout parses as-is for programmatic and GUI callers.exec <name>without a command opens a login shell (zsh, else bash, else sh), the same one the dashboard's terminal opens. With neither-inor-tgiven it runs with-i, plus-twhen stdin is a TTY, so it works as is from a terminal or a pty (node-pty); explicit flags are used as given.- npm:
execArgv(name, cmd?, { tty, interactive })returns{ file, args }for spawningdevsandbox execyourself (node-pty,child_process.spawn) without shell quoting. rm --delete-branch/rm --keep-branchanswer the "delete branch?" question without prompting, so scripts and other callers without a TTY can clean up the branchruncreated.--delete-branchdeletes it like answering yes (git branch -D, so unmerged commits go too);--keep-branchkeeps it. Branchesrunreused rather than created are always kept. With neither flag,rmstill asks on a TTY and keeps the branch otherwise. npm:rm(name, { deleteBranch }), wheretrue/falsepass--delete-branch/--keep-branch.- Docs site at devsandboxes.com: a quick start, a playable tour of the dashboard, the full
config.tomlreference, the Node API reference, ten worked examples (parallel coding agents, shared and per-instance services, package caches, ssh-agent andgit push, babysitting pull requests, porting adevcontainer.json, …), full-text search (⌘K / Ctrl+K) and this changelog.
Changed
-
Worktrees reuse existing branches.
run --branch X, and a dispatcher'sdevsbd ensure --branch X, no longer fail whenXexists:- a local
Xis checked out as it is; - an
Xthat only exists onorigin(a PR head, for example) becomes a local branch trackingorigin/X, so a plaingit pushupdates it; - a branch that's already checked out somewhere else gives an error saying where.
rmonly offers to delete branches devsandbox created itself. - a local
-
New containers use
sh -c '… devsbd boot & exec sleep infinity'as their command instead ofsleep infinity, so images need/bin/sh. -
startsets the container's restart policy fromautostart, overwriting a policy set by hand. -
While the dashboard is open it keeps a helper connection to every running instance that has the helper, not only when an ssh-agent is being relayed.
-
devsandbox status --jsoninstance rows includeinstance_idand, for children,dispatcher. -
rebuildappliesworktree-include. Before, adding a pattern marked instances as drifted, but the rebuild copied nothing. Nowrebuildcopies any missing matching files into the worktree; existing files are never overwritten. A copied file you delete on purpose comes back on the next rebuild, so drop the pattern instead. -
devsandbox port 3000(and the Ports tab) moves to 3001, 3002, … when 3000 is taken on the host, instead of a random port. -
A service
portsentry that gives only the container port ("5432") now gets the same port on the host when it's free, instead of a random one. If the port is taken, the runtime still picks one. -
An exact instance name wins. With instances
webandweb-2,devsandbox exec web(andrm,stop,logs, …) now means the instancewebinstead of an ambiguity that failed off a TTY and prompted on one, including inside a pty. An exact instance id counts too; sandbox and folder names only apply when nothing matches exactly.execnow uses the same resolution as the other verbs, so it also accepts an instance's id after a rename. -
npm (breaking):
run()resolves with the new instance's record (RunRecord) instead of its name; use(await run(...)).namefor the old value. It callsrun --json, so build and autostart output can no longer end up as the "name".
Fixed
rmon a dirty worktree no longer leaves an instance without its container.rmremoved the container, volumes and services first, thengit worktree removerefused the uncommitted or untracked changes, stranding the instance. It now checks the worktree first and refuses with the list of changes, removing nothing.- Keyboard chords like ctrl+m reach apps in dashboard terminals. In terminals that support the kitty keyboard protocol (kitty, Alacritty ≥ 0.13, Ghostty, WezTerm, foot, iTerm2 ≥ 3.5), the dashboard now turns the protocol on and passes it through to apps inside its terminals that ask for it. zidane's ctrl+m, for example, no longer arrives as Enter. Shells and other apps that don't ask for it get the same keys as before. GNOME Terminal and tmux don't support the protocol, so there ctrl+m and Enter still can't be told apart.
- The mouse wheel scrolls full-screen apps in dashboard terminals. It used to scroll only the terminal's own scrollback, which full-screen apps don't have. Now apps that track the mouse (zidane, vim with
mouse=a, htop) get the wheel directly, and pagers likelessandmanget ↑/↓. Shells still scroll their history. - Forwarded ports reach servers listening only on IPv6 loopback. Dev servers told
localhost(webpack-dev-server, Vite, Node 17+) often bind only[::1], while forwards dialed127.0.0.1, so every connection was refused. A loopback dial now also tries the other family (127.0.0.1↔::1). Running instances pick up the new helper when restarted. worktree-linkworks for several sandboxes on the same folder. The shared copy used to live in one store per sandbox. The base checkout can only link to one of them, so the second sandbox's worktrees got nothing. The store is now per repo:shared-files/<folder name>-<hash>/, shared by every sandbox on that folder. The nextrunorrebuildmoves files from the oldshared-files/<sandbox>/stores and relinks the base checkout and worktrees. Instances still running on an old store need arebuild. If two old stores held different copies of a file, the one the base checkout linked to wins, and the other stays where it was with a warning.- ssh-agent forwarding no longer breaks
runon macOS + docker in builds without the helper (cargo install). The fallback bind-mounted the Mac's launchd agent socket, which can't cross into the runtime VM, sodocker runfailed withmkdir …/agent/<instance>.sock: file exists. It now mounts Docker Desktop / OrbStack's/run/host-services/ssh-auth.sockinstead. Builds that embed the helper were never affected. devsandbox portand the Ports tab work on macOS. Accepted connections inherited non-blocking mode from the listener there, so every relay read failed withos error 35and no forwarded connection got through.- 0.4.0 never reached crates.io (the publish step failed on the release archives in the checkout);
cargo install devsandboxgoes straight from 0.3.4 to this release.
Security
- Git on the host can no longer run code planted by a sandbox. Worktree instances mount the base repo's
.gitread-write, so a container could plant hooks or command-running config (core.fsmonitor,core.sshCommand, filter drivers,include.path, ...) that the host'sgit worktree add/fetch/worktree removewould then run as you.- Every git command devsandbox runs on the host now has hooks and fsmonitor turned off.
- It first checks the repo's local config against an allowlist. If a key could run a command, it refuses and names the key: review it and remove it.
ext::remotes and object alternates are refused as well. - This affects every worktree instance, not only dispatcher children.
- The commands devsandbox runs as root inside containers (helper install, boot file, Apple
/etc/hostsupdate, workspace file) use/bin/shwith a fixedPATH, so they don't depend on the container'sPATH. - Limits on what a container can make the host do:
- at most 8 concurrent notify/control handlers per container;
- output from host-run commands is capped and timed out (5 min for in-child commands, 30 min for dispatch operations, which are killed with their whole process group);
- desktop popups are rate-limited per instance (3 at once, then one every 10 s), and repeats of the same key within 60 s don't pop up again;
- the inbox keeps at most 50 entries per instance (200 overall);
devsbd run lslists only the newest 50 runs and shortens long command lines.
Commits
- c0af00e feat(site): add a changelog page rendered from CHANGELOG.md
- d70eb16 fix(npm): keep execArgv names from parsing as flags, correct exec/run docs
- d5e0884 fix(rm): refuse a dirty worktree before tearing anything down, add branch flags
- 623710f feat(cli): make run, exec and name resolution usable from programs
- 88a16b9 docs(site): add a dashboard tour page that walks through each feature beside a sticky, playable mini dashboard, so readers learn the tui before installing it
- e3d2b28 feat(site): fake the command prompt, port forwards, logs, config explorer and run/stop in the mini dashboard, so the docs can teach every key hands-on
- ef295b7 docs(tui): document kitty keyboard pass-through and wheel routing for integrated terminals
- 47a6a19 docs(tui): correct the pty TERM comment, docker exec does not forward it into the container
- ba99a4f fix(tui): answer xtversion in integrated terminals, since opentui apps like zidane ignore the kitty flags reply until the terminal identifies itself
- 52d9194 fix(tui): send the mouse wheel to integrated-terminal apps that track the mouse or use the alternate screen, which has no scrollback to scroll
- fb9e02d feat(tui): send kitty-encoded keys to integrated-terminal apps that enabled the protocol, so ctrl+m no longer arrives as enter
- 95c6236 feat(tui): emulate the kitty keyboard protocol's flag stacks and queries in the integrated terminal, so apps inside can opt into it
- 0ac6963 refactor(site): extract the mini dashboard into a mountable component, so the docs can host a second one driven from outside
- dd3ad31 feat(tui): enable the kitty keyboard protocol on terminals that support it, so chords like ctrl+m can reach apps in the integrated terminal
- 721b5ab feat(site): make t open a terminal in the landing mini dashboard, split and tabbed like the real one, so the preview shows the feature it advertises
- 7ff786f fix(site): tighten the examples that need no setup and make the pr babysitter readable at a glance
- b126a11 docs(site): trim the pr babysitter example to the new example shape and give its loop a codex variant, so it works with the reader's agent
- f5cb4c1 docs(site): trim the features and devcontainer porting examples to the new example shape, keeping the porting reference tables readers come for
- a1ee4f4 docs(site): trim the port forwarding and vs code examples to the new example shape, and stop calling forwardPorts ignored now the dashboard honours it
- c0d24e9 docs(site): trim the caches and ssh push examples to the new example shape, with the agent picked by the reader on the push one
- 2b6c5ae docs(site): trim the shared and isolated services examples to the new example shape, with the agent picked by the reader on the isolated one
- 06fb312 feat(site): let readers pick their coding agent once and trim the parallel agents example, so examples read short and match the agent they use
- 0e41f55 feat(site): animate the how-it-works section and make the mini dashboard playable, so pressing o shows vs code attaching to a sandbox
- ab6d22b feat(site): how-it-works section with a host/sandboxes/agents diagram next to a mini dashboard, so visitors see how the tool is used
- 59e5404 feat(site): position the landing page as devcontainers for ai agents and drop the devcontainer comparison the audience doesn't need
- b0b5a9b fix: add github icon to link
- edda15a ci(site): move pages deploy into a dispatchable workflow that release calls, so docs-only changes can ship between releases
- 9e23dc4 ci(site): build the docs site on every pr and deploy it to pages on release, so the docs always match what users can install
- 83bd81b fix(site): load sidebar nav styles on every page, so the mobile drawer outside /docs has no bullets or stray chevrons
- 5c0961c docs(config): escape the pipes that truncated the dispatcher row and name the real service/gc commands
- 9400e75 feat(site): 404, og image, one reading order with prev/next and edit links, a link check in the build, and a warning-free build
- 874d74b feat(site): pagefind full-text search behind a ⌘k dialog, so any field, flag or example is one keystroke away
- 6dd530f feat(site): remaining examples, port forwarding, vscode, features, the pr babysit dispatcher and porting a devcontainer.json
- f140d5f feat(site): examples section with one recipe per use case and a copyable agent prompt, starting with worktrees, services, caches and ssh
- 2fc8c4b feat(site): node api reference generated from the npm package's index.d.ts, so the docs follow the published typings
- d127052 feat(site): config reference rendered from the config-toml-spec skill, so the site and the agent skill never drift
- ce29397 feat(site): quick start page, from install to a second worktree instance and the dashboard
- fc10522 feat(site): landing page that pitches devsandboxes as devcontainers multiplied, with a hero that mirrors real run/ps output
- 7454a57 feat(site): scaffold the astro docs site with the prototype's design system, so docs pages can be written against a real shell
- cd577ab feat(port): forward sandboxes' forwardPorts from the tui, keeping each instance's host ports in state so they stay the same across restarts
- 70553ce feat(services): give a bare service port the same host port when it's free, instead of letting the runtime pick a random one
- 043c1de fix(port): clear o_nonblock on accepted sockets, since macos inherits it from the listener and every relay read failed with os error 35
- a0061d2 fix(port): try the other loopback family when dialing, so dev servers bound only on ::1 (node's localhost) are reachable
- 44f357a fix(ssh-agent): mount docker's magic agent socket on macos, since the launchd socket can't cross into the vm and failed docker run
- 5607ad3 fix(worktree): keep worktree-link files in one store per repo, so several sandboxes on the same folder all get the shared files
- fb94fab feat(dispatch): ensure --env replaces a child's saved env and every exec applies it, so new values take effect without a rebuild
- 37fc704 docs(changelog): list the step 13-15 commits
- 9d7efc8 feat(dispatch): devsbd run rm and run prune, so dispatchers can clear runs instead of letting them pile up
- 2608a23 fix(autostart): never start or create dispatcher children at boot, so idle children the dispatcher parked stay stopped
- 54193b6 feat(run): keep --env values in state so rebuilds, including a dispatcher recreating a child, don't drop them
- 57237dc fix(rebuild): copy worktree-include files on rebuild so the drift a new pattern raises is actually fixed by rebuilding
- 2feb352 docs(changelog): unreleased notes for the security hardening and existing-branch worktrees
- d022e5c feat(run): reuse an existing local or origin branch for a worktree instead of refusing, so instances and dispatcher children can work on PR branches
- 36f532a fix(port): look up lsof on the container's PATH again, the --env deny-list already closes the PATH injection and the fixed PATH hid lsof in /usr/local/bin
- e5404ac fix(devsbd): cap run ls to the newest 50 runs and bounded argv/meta reads, so a container user can't make run listings unbounded
- aac1539 fix(dispatch): bound handler threads, child output and runtimes, and rate-limit desktop popups, so a container can't exhaust the host or flood the desktop
- 4c1549f fix(dispatch): deny dangerous --env names, keep children from being dispatchers, cap children at 10 by default and run host root execs with a fixed PATH, so a dispatcher can't gain root in a child or self-replicate
- 11b9f7a fix(dispatch): validate dispatcher branch names and never template-expand them, so a container can't read host env through ${localEnv:…}
- a5948da fix(run): host git runs with hooks and fsmonitor disabled and refuses repos whose local config can run commands, so a sandbox can't execute code on the host through the shared .git
- c59d627 docs(automations): plan security fixes for host git, branch values, dispatcher authz and resource limits
- f44f329 docs(changelog): unreleased notes for automations, and plan steps for the follow-up decisions
- 5c2e49a docs(automations): user guide, architecture and module map for autostart, notify and dispatchers
- b080bf1 fix(autostart): keep the boot's pass when the runtime is unreachable and pin dispatch subprocesses to the parent's backend, found auditing apple container
- 7868cb5 feat(dispatch): tracked runs in child instances (devsbd exec, run ls/logs/wait), so dispatchers can start agents and follow their outcome
- d499764 feat(dispatch): devsbd ensure/ls/stop/rm over a control channel served by the dashboard, failing fast with 75 when no host is attached
- 32a030d feat(dispatch): dispatcher config and host-side control handler that runs ops as logged subprocesses, so a sandbox can safely own child instances
- d5a1f6f feat(tui): inbox tab with per-instance unread badges, so notifications stay reviewable after the status line moves on
- cec26b4 feat(tui): serve devsbd notify streams from dashboard bridges and raise desktop notifications, so container messages reach the user
- 35f2e7c feat(devsbd): notify queues records in a durable outbox and the daemon flushes them to notify-capable hosts, so no message is lost while no host is attached
- c3ae6ce feat(devsbd): boot hook in the container command so runtime restarts bring back the helper daemon and postStartCommand without a host
- 75345d6 feat(autostart): runtime mode sets --restart unless-stopped so docker/podman bring sandboxes back on boot without devsandbox, flipped in place on start
- 9075dec feat(autostart): bring autostart sandboxes up once per boot from the tui or the first run/start, so automations survive a reboot
- 74ff407 docs(automations): step plan, with triggers, per-root boot ids and runtime-mode poststart settled
- 6bb660e docs(automations): design for autostarted sandboxes, notify and dispatcher-driven child instances
- 0442d37 fix(ci): download release archives outside the checkout so cargo publish sees a clean tree