Skip to content

Releases

v0.11.1

Choose a tag to compare

@github-actions github-actions released this 24 Nov 13:56

A call a sandbox's config marks as asked now waits for your answer instead of failing, and tags, releases and ref deletions always ask. Sentry credentials reach only the orgs they name, devsandbox ps lists instances like the dashboard, and terminal questions are answered from a list. Existing sentry credentials need their orgs, with the sentry feature 1.3.0.

Added

  • Permission requests: an asked scope waits for your answer instead of failing. A call needing a scope in a sandbox's access.<kind>.ask (or one in no scope of an unfenced claim) is now held, up to the claim's hold (2 minutes by default), while you answer from the dashboard's modal, the desktop popup or devsandbox access pending|approve|deny: --for once (the default), instance (this instance until its rm) or always (a rule on the credential in credentials.toml, which you can also write by hand). A deny is kept, so a retrying agent is refused at once; devsandbox access revoke R-… drops a kept answer or rule. An agent refused while a request is pending can run devsbd access wait R-… in the sandbox and retry once it's answered. An instance gets at most three open requests, so volume can't wear you down.

    devsandbox access pending
    devsandbox access approve R-7Q2M9XK4TB0D --for instance
  • Tags, releases and ref deletions always ask. With gh's claim, deleting a branch, creating, moving or deleting a tag (REST git/refs or GraphQL createRef/updateRef/deleteRef) and publishing a release are asked every time, on each tag or ref, even when the scope allows them (creating or moving a branch isn't): answered once or for this instance on that one target, never always, and no rule opens them. A draft release isn't asked until it's published, so gh's draft-then-publish is one question. Pushes over git aren't asked yet.

Changed

  • Sentry credentials reach only the orgs they name. A Sentry token spans every org its account is in; now a sentry credential names the orgs sandboxes may use, with devsandbox login --org <slug> (repeatable, each checked with the token), and the broker refuses calls naming any other org, by slug or id. The org list sentry gets shows only those orgs, and access.sentry.orgs in a sandbox's config narrows it further. A credential naming none has every org call refused, so an existing sentry credential needs its orgs: log in a new one under a new name (devsandbox login sentry-my-org --feature ghcr.io/devsandboxes/features/sentry:1 --org my-org) or add orgs = ["my-org"] to its entry in credentials.toml. Needs the sentry feature 1.3.0, which also drops the routes that listed other orgs' projects and app installations.

    [sandbox.web.access.sentry]
    orgs = ["my-org"]
  • devsandbox ps lists sandbox instances, like the dashboard. One row per instance with its sandbox, status, uptime and CPU/memory (plus PROFILE when one has a profile, MACHINE when machines are registered, their rows included); -a adds stopped ones. Services are in devsandbox services ls. ps --json prints what status --json did, so stats and status are gone, and so are the containers.list / containers.stats API methods (and the npm package's stats() / status(); ps() returns the snapshot).

    devsandbox ps -a
  • The dashboard's Detail panel keeps what a build said. An instance's warnings and notes from its last run, rebuild or start (the identity summary, the GitHub fence, every warning:) stay on it and show under its details, next to whether the browser sandbox is on and its GitHub fence. The details lay out in two columns when they fit.

  • Terminal questions are answered from a list. Every yes/no and menu on a TTY (login's claim review, machine trust, rm, the identity question) is a list you pick from, defaulting to the safe answer, so a stray key can't approve. login shows a claim as a folded tree of routes and scopes, and asks which login method to use when several work instead of picking one silently.

Fixed

  • VS Code no longer hands a claimed sandbox your logins when it can avoid it. devsandbox vscode and the dashboard's o start code without your ssh-agent or git credential helper for an instance with a credential claim, and open it without asking when no other VS Code window could leak them (checked on Linux). Otherwise the dashboard now asks before opening, and :code takes --allow-credential-leak like the CLI.
  • A misspelled top-level table is an error: [sandboxx.web] used to load
    as an empty config with no warning; now devsandbox names the unknown
    table, as it already did for unknown keys inside a sandbox.
Commits
  • f524850 docs(ps): archive the ps-daemon plan, its content now lives in snapshot-and-json
  • 60db185 fix(ps): read the daemon's federated snapshot like the dashboard, since a local collection plus per-machine calls skipped the merge's rules and the poll's cached stats
  • 3c44075 docs(prompts): close the terminal prompts plan, its content now lives in cli-prompts and the credentials reference
  • 29e72e3 feat(prompts): answer every cli yes/no and menu from a list, so machine trust, rm and the identity question read like login's and default to the safe answer
  • 506b0c8 feat(login): ask which login method to use on a terminal when several work, since the silent pick hid that a browser or paste login was there
  • 0d0d8f5 feat(login): review a claim as a folded tree and answer approve/refuse from a list, so never routes and scopes read at a glance and a stray key can't approve
  • f1577df feat(ask): select, fold and review prompts redrawn in place on a tty, so questions can show folded details and take a picked answer instead of a typed y/N
  • 5e94871 docs(prompts): plan styled, foldable, pick-from-list tty prompts
  • 8d7bdb3 feat(tui): keep a build's warnings and notes on the instance and show them in a two-column detail, since they were lost once the build log scrolled by
  • dadaa35 feat(ps): list sandbox instances with their usage like the dashboard, since a raw container listing plus separate stats and status verbs said less with more commands
  • f55a539 fix(vscode): start code without the ssh-agent and git credential helper for a claimed instance, and let the dashboard open one anyway like the cli
  • 08889c0 feat(broker): ask a person for tags, releases and ref deletions whatever the scope allows, since no rule should publish for them
  • d238f50 feat(devsbd): access wait blocks on a permission request, so an agent retries its call once it's answered
  • 76a0b0b feat(tui): a modal answers permission requests as they open, and a desktop popup names the command, so a held call needn't time out
  • 81a8aa9 feat(access): pending, approve and deny answer permission requests from the terminal
  • 8084400 feat(api): list and answer permission requests over access.pending and access.decide, local clients only
  • 1f9e5f8 feat(broker): keep this-instance, always and deny answers, so an answered ask isn't asked again
  • 88865ed feat(broker): hold an asked call for its permission request instead of refusing it, so an answer lets it through
  • f206473 docs(broker): split permission requests into what's built now and what waits on pushes, links and agents
  • 4a7c96d feat(sentry): follow features/sentry 1.3.0's org fence, checked end to end, so existing credentials learn they need orgs
  • 727f9db feat(login): --org names a sentry credential's orgs, checked with the token, and access ls shows them, since a credential naming none has its org routes refused
  • e5b0985 feat(broker): enforce the org fence and cut org lists to it, so a sentry token reaches only the orgs its credential names
  • 731ee26 feat(credentials): a claim can fence an org path variable, so a credential and a config can name the orgs it reaches
  • 1ca365c docs(sentry): plan the org fence, since the shipped claim's tokens reach every org the account is in
  • fc2f518 docs(credentials): record what 0.11.0 shipped with: sentry's claim spans orgs, the broker is http/1.1 only, drains cut broker streams
  • 3ca4b57 fix(config): refuse an unknown top-level table, so a typo like [sandboxx] isn't silently ignored
  • 3028a4b docs(site): close the site refresh and release plan

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 23 Nov 08:55

Sandboxes can use gh, git and Sentry's CLI without ever holding your tokens: devsandbox's credential broker keeps them on the host and spends them only on what each sandbox's config allows, gh and git only on the sandbox's own repos. Features now update their tools on a schedule, with no rebuild and no sandbox able to swap them, and host git no longer follows anything a sandbox can write. The features gh 1.3.1, zidane 2.1.1 and sentry 1.2.1 need this release.

Added

  • Sentry's CLI without its token in the sandbox. The new ghcr.io/devsandboxes/features/sentry feature installs Sentry's sentry CLI and claims a sentry credential. The sandbox gets a phantom SENTRY_AUTH_TOKEN, and its calls to sentry.io and the region hosts reach devsandbox's credential broker on the host, which checks each against the claim's scopes (issues, events, releases, uploads, alerts, dashboards, …), swaps the phantom for the real token and calls Sentry. Deleting an org, project or team and minting tokens are refused whatever the config. Any feature can claim a credential the same way, in its customizations.devsandbox.credentials, either intercepting its hosts or giving the tool a loopback base URL.

  • gh without its token in the sandbox, fenced to the sandbox's repos. The new ghcr.io/devsandboxes/features/gh feature installs the GitHub CLI and claims a github credential: gh, git and anything else calling api.github.com reach GitHub through devsandbox's credential broker with a phantom token. Calls on the sandbox's own repos (its folders' remotes plus access.github.repos) get the real token, scoped per sandbox (repo.read, pr.write, pr.merge, issues.write, git.push, releases.write, actions.read, actions.write, …); other repos are read anonymously and never written; GraphQL writes are checked by every id they name. Deploy keys, webhooks, runner tokens, secret writes and other routes that would plant access are refused whatever the config. Use it instead of ghcr.io/devcontainers/features/github-cli. gh runs from a shared dir the sandboxes mount read-only, kept current by feature updates (below), so no sandbox can swap the gh the others run.

    devsandbox login github --feature ghcr.io/devsandboxes/features/gh:1 --profile work
  • devsandbox login and devsandbox access approve. login stores a credential's secret on this host and approves the claim of the feature it's for, which it shows you first. A feature release that changes its claim needs approving again, with access approve, which shows what changed, or when run asks. --profile limits a credential to the sandboxes of those profiles.

    devsandbox login sentry-work --feature ghcr.io/devsandboxes/features/sentry:1 --profile work
  • devsandbox login by device code or browser. A claim that lists the device or browser login gets its token by OAuth: login shows a code to enter at the provider's page (works on a headless box), or opens the provider's login page and takes the redirect on a loopback port. --method picks among the claim's methods, and --client-id logs in to your own OAuth app (a GitHub App you made) instead of the feature's, or names the app when the feature ships none: features/gh offers GitHub's device flow that way. The token, its refresh token and expiries are kept on the host, and the broker renews the token before it expires (or when the provider rejects it, replaying the call), so tools in the sandbox never see it change. A credential whose renewal is refused is marked broken until you log in again.

    devsandbox login github --method device --client-id Iv1.0123456789abcdef
  • devsandbox access ls and access revoke. ls lists this host's credentials: who they're granted to, whether the token is pasted or OAuth and when it expires (never the token), the approved and pending claim versions, and the instances using each, with the version they run and whether it's approved. Versions nothing uses are marked. revoke deletes a credential's secret and entry, or with --version drops one claim version, showing first which instances lose access.

    devsandbox access ls sentry-work
    devsandbox access revoke sentry-work --version 3f2a1b
  • GitHub tokens that stay narrow, and a warning before they expire. devsandbox login for a GitHub credential takes fine-grained PATs (github_pat_…) and GitHub App user tokens (ghu_…) and refuses classic PATs, which reach every repo you can; gh's own OAuth token only with --broad (below). access.github.as in a sandbox's config picks which kind of token a sandbox takes, within the kinds the credential offers (as in credentials.toml, ["user"] by default). access ls shows when a credential expires and warns two weeks ahead, and in its last week you get a desktop notice once a day while sandboxes use it.

  • GitHub logins that land on the right token. For a pasted token, login opens GitHub's fine-grained token page prefilled with a name, a description and the permissions the claim's granted scopes need, so you only select the repos; --owner prefills the user or org that owns it. Before storing any token, login checks it against the provider and says whose it is (… as alice), so a work credential can't silently be your personal account. Login pages open in the browser of the credential's profile, where its account is signed in.

    devsandbox login github --feature ghcr.io/devsandboxes/features/gh:1 --owner my-org
  • login --broad for orgs that allow neither a GitHub App nor fine-grained tokens. It makes a broad credential, which takes gh's own OAuth token (gho_…, by gh's device login or pasted), after a confirmation naming its reach: the repo fence still refuses writes outside the sandbox's repos, but GraphQL reads aren't fenced, so a sandbox can read every repo the account can. Narrow tokens stay the default, and a credential is broad or not from its first login.

    devsandbox login github --feature ghcr.io/devsandboxes/features/gh:1 --broad
  • Feature updates keep tools current with no setup and no rebuild. A feature can declare updates (customizations.devsandbox.updates): a command baked in its image that refreshes a ${sharedVolumes} dir its sandboxes mount read-only, gh's binary for one. The daemon runs each due update when it starts and then hourly, every 7 days unless the feature or the config's [updates] says otherwise, in a throwaway container from the sandbox's features image with only that dir writable: no sandbox can swap the binary the others run, and no feature code runs on the host. A failure is retried after 6 h and posts an Inbox notice; each run's output is in logs/ next to state.toml. devsandbox update <name> runs one now, and a version after the name pins or rolls back. An image runs the updates it was built with, so a feature release that moves its updater reaches an image at its next rebuild. Not on Apple's container yet.

    [updates]
    gh = "1d"
    devsandbox update gh 2.60.0
  • run asks to approve a changed claim. When a feature release changes a credential claim, run on a terminal shows what changed and asks, instead of refusing and sending you to access approve; a yes approves it and the run goes on. Off a terminal (--json, -d, the dashboard, rebuild, a machine's run) it still refuses.

  • access.<kind> in a sandbox's config picks the credential a claim takes (credential) and narrows what the sandbox may do with it (scopes). Edits apply to the next call, no rebuild.

    [sandbox.web.access.sentry]
    credential = "sentry-work"
    scopes = ["releases.write", "uploads"]
  • Intercept-mode credential claims. A feature whose claim intercepts its hosts (gh's api.github.com, say) now works with the tool as it ships: the sandbox gets HTTPS_PROXY pointing at the helper, which hands only the claimed hosts to the broker and dials everything else itself (through the proxy the container already had, if any). The broker's per-host certificates chain to this host's member CA, which run installs into the container's system CA bundle (update-ca-certificates, update-ca-trust, or the bundle itself) and names in NODE_EXTRA_CA_CERTS, DENO_CERT, REQUESTS_CA_BUNDLE and AWS_CA_BUNDLE. A new claimed host reissues the CA and reinstalls it in the running sandboxes; a stopped one gets it at start. run warns when remoteEnv or --env sets a proxy variable, which would bypass the route.

  • Each folder's remotes are recorded at its first run. Before a folder's first container, run reads its git remotes (any host; host paths, file:// and ext:: URLs dropped) into state.toml and prints the GitHub repos among them: the repos a sandbox's GitHub credential will be fenced to. The record is never re-read, so a remote a sandbox adds or rewrites later never counts, and rm keeps it. access.github.repos adds repos; devsandbox access forget <folder> <repo> drops one (instances take it at their next start or rebuild); access ls lists each folder's fence.

    devsandbox access forget ~/src/app someone/planted-repo
  • The broker enforces the repo fence, git over HTTPS included. A claim that declares a fence gets its credential only on repos in the sandbox's fence: its folders' recorded repos plus access.<kind>.repos. Outside the fence a read goes to GitHub without a credential, as a stranger's would (public repos and git dependencies work), marked devsandbox-fence: outside; a write or a git push is refused before git sends anything, naming access.<kind>.repos, and so is an upstream 401, so git never prompts for a password. Claim routes take {repo} (owner/repo, case-insensitive, .git dropped) and a ?service= style query constraint, so git's fetch and push map to their own scopes.

  • ...

Read more

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 10:13

A config can now belong to the whole fleet and keep running on an always-on server while the host it was written on is off. Links a sandbox opens land in your desktop browser, picked per profile. Sandboxes and services get NVIDIA GPUs from hostRequirements.gpu, and placement sends them to a machine that lends one. Members run the build the fleet's authority pins.

Added

  • A config every machine runs. On the fleet's authority (the host of its first machine add), a run, rebuild or start signs the config's next version when it changed and sends it to every machine, which installs its own copy. Machines keep the latest signed version while the authority is offline and build only from an exact copy of it, so a copy edited in place is refused and restored. The verb's output names any machine that didn't get it, and running the verb again retries those. A run box/<sandbox> from the authority also brings the sandbox's repos to box, uncommitted work included.

    devsandbox machine add box --control-plane   # on the authority, signs its configs for box
    devsandbox run web                           # on the authority, signs a changed config and sends it
    devsandbox run box/web                       # from the laptop, even with the authority off
  • A laptop can drive a server. A laptop joining with devsandbox machine add box gets its join proposed to the authority, which approves it with devsandbox machine approve <id>. A host with no container runtime is a clean driver. The dashboard says no runtime, nothing is placed on it, and a bare run <sandbox> goes to the machine that runs it.

  • Links opened in a sandbox open on your desktop. xdg-open, $BROWSER, webbrowser, Node's open and CLI logins open http(s) URLs in the host's browser. A localhost URL or OAuth callback gets a port forward first (marked (open) in the Ports tab, stopped after 10 minutes idle), so dev servers and gh auth login work. A link opens on the host that last attached to the instance with a terminal, so a server sandbox you exec into from your laptop opens on the laptop. The dashboard's status line says what happened to each link, and devsbd open <url> does the same from scripts.

  • Profiles pick that browser. Declare them in the config, list the ones a sandbox allows, choose one at run and switch it any time without a restart. Each host maps profiles to browsers in its own profiles.toml next to state.toml. ps, inspect and the dashboard show an instance's profile and flag one its sandbox no longer allows.

    [profiles.work]
    [profiles.personal]
    
    [sandbox.web]
    folder = "../web"
    image = "node:22"
    profiles = ["work", "personal"]
    # ~/.local/share/devsandbox/profiles.toml
    [work]
    open = ["google-chrome", "--profile-directory=Profile 2"]
    devsandbox run web --profile personal
    devsandbox profile web work       # or P / :profile in the dashboard
  • GPUs. hostRequirements.gpu = true on a sandbox or a service gives its container every NVIDIA GPU (docker's --gpus all with the nvidia runtime, else the CDI spec on docker or podman). When none is usable, run stops before building, and "optional" warns and runs without. run --place puts a sandbox that requires a GPU only on a machine that lends one, and prefers one for an optional GPU.

    [sandbox.ml]
    folder = "../ml"
    image = "pytorch/pytorch"
    hostRequirements.gpu = true
  • devsandbox machine allow sets what work placed on this host may use, instead of editing [allow] in member.toml. Only the host itself can. machine add asks the machine what to lend over your ssh session, or takes --allow, --allow-bind and --allow-local-env.

    devsandbox machine allow --gpus on --bind-add ~/datasets
    devsandbox machine add box --allow gpus --allow-bind /srv/data
  • Members run the build the authority pins. The authority signs its build into the membership log, and members download that release and check its sha256 before running it (a source build only with dev-builds = true in member.toml or full trust), so a compromised control plane can't push code. machine ls shows a machine behind the pin and why. devsandbox machine upgrade <m> copies this build over a machine's over ssh, for the control plane the authority no longer follows.

  • Sessions in the dashboard. An instance's helper sessions show as rows under it. a or enter attaches, K ends one, and a on the instance picks a detached one. devsandbox exec web --end <id> ends a session from the CLI. A terminal over a fleet link to an instance with a non-root user is now a session too, so a dropped link no longer ends it.

  • A warning when a nested docker can't work from a shell. On rootless docker with runc before 1.4.1, exec'd processes land outside the container's cgroup, so a docker-in-docker dockerd started from a shell fails. run, start and inspect now say so. Upgrade the host's runc.

Changed

  • The fleet's hub is now its control plane, the Kubernetes name for the role. It is control_plane = "self" | "<name>" in member.toml, devsandbox machine control-plane <m> moves it, machine add --control-plane picks it for a new fleet, and the API and index.d.ts call it control_plane.
  • machine add picks no config roots (--config is gone). A machine's roots are the ones its daemon lists, kept live as it installs signed copies. A command on a machine with no root given uses its signed copy, else its ~/.devsandboxes.
  • The docs site is much shorter. Machines moved to /docs/machines, the basics are on the quick start, the two services examples are one /examples/services page, and the Features and VS Code examples are gone (their content lives in the quick start, the devcontainer port guide and the dashboard tour).

Fixed

  • Ctrl-D in the dashboard no longer removes an instance. One-key actions ignored modifiers, so Ctrl-D (a shell habit, or the EOF a closing terminal sends) counted as d, and Alt-Y answered a confirm. Letters and symbols now fire bare or with Shift only. Ctrl-C and Ctrl-] keep working, and a focused terminal still gets every Ctrl key.
  • A pipeline whose command starts the daemon no longer hangs. The daemon kept any fd the CLI had inherited, so devsandbox … | cat could wait forever on a pipe the daemon held. It now starts with only its own stdio.
  • devsandbox exec web zidane from a terminal gets a terminal. A command given to exec ran without -i -t unless asked, so a TUI drew at 80x24, saw no input and left its terminal replies on screen. From a terminal it now gets -i -t and a resumable session, and piped stdio stays plain.
  • The dashboard shows a fleet config's sandboxes once, with every host's instances under one group, instead of again per machine. The instances detail panel grows to fit, so the drift line no longer falls off.
  • Service networks no longer break DNS on rootless docker. A new service network covering a host route, gateway or nameserver is recreated on a free /24 of 10.200.0.0/16, with a warning. devsandbox gc now removes unused service networks on docker too.
  • Caches, shell history, ${sharedVolumes} mounts and worktree-link no longer keep a sandbox home under run --place. A placed instance starts them empty on the worker, and a "not placed" note lists each tie once.
  • Upgrading the authority first no longer locks it out of an older control plane or silently downgrades it.
  • Attaching without an id takes an attached session too, and a session's creator sees the program's first output.
  • A machine's root removed there leaves the dashboard without a daemon restart, and a root that errors no longer sticks as a permanent error.
Commits
  • ec10147 docs(site): cover sessions, the driver laptop, ctrl chords and gpus, merge the services examples, drop the features and vscode ones and cut the docs by 40%
  • 1d17cda docs(agents): list the profile, rename, vscode, status and fleet-link command files
  • b3929a2 chore(comments): drop machine add's roots claim and history wording from machine.rs
  • 2fc8199 docs(plans): move parked and proposed plans to explore and mark fleet planned, so active holds only agreed work
  • 4026122 docs(cli): list profile, machine allow/control-plane/approve, exec sessions and controlPlane where the reference and cli skill still lacked them
  • ac68b55 fix(serve): start the lazy daemon with every fd above stdio close-on-exec, so a pipeline whose command starts it no longer hangs on a pipe the daemon inherited
  • 2ad5bcc fix(tui): fire one-key actions only bare or with shift, so ctrl-d out of shell habit or a closing pty's eof no longer removes the instance under the cursor
  • 83a6ee8 docs(status): park terminal replies echoed after exec returns, since nothing flushes pending tty input
  • cf69da4 docs(site): cover profiles, links, gpus, lending, control plane and pinned builds, move machines to /docs/machines, and trim docs, examples and architecture to what a reader skims
  • 5f9ad03 docs(machines): a machine verb runs over an api stream on the link, not an ssh of its own
  • 8a44299 docs(cli): exec's help says a command from a terminal gets -i -t, machine roots' help drops add picking roots, and the control-plane plan marks the rename shipped
  • b717513 fix(fleet): list a sandbox's tie once even when repeated apart, and show ${instance} paths as , so not-placed notes don't repeat or name a literal instance dir
  • aba5e49 docs(status): record the hand-run gpu check on docker cdi and what is still unverified
  • 9ce5bcd docs(gpus): close the gpu plan: adrs for spec-compatible gpus and lent-gpu placement, follow-ups parked
  • c308945 feat(machine): ask at machine add what the target lends, applied over its own ssh session
  • 855d759 feat(machine): set worker all...
Read more

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 16:14

One user model on every runtime: inside a sandbox you are a user with your host uid/gid, so workspace files come out owned by you on rootful docker, rootless docker, rootless podman and VM-backed runtimes alike. Browsers keep their own sandbox wherever it can work, and tools are told when it can't. Interactive exec sessions survive a dropped connection: --attach gets the program back, and a machine's terminal reconnects by itself. Machines become one fleet: members with their own keys and trust, a hub, routing through other members, run --place to send a sandbox where there's room and devsandbox fetch to bring the work back. Fleet is experimental in 0.9.0: its commands, config, files and the protocol between machines may change between releases with no migration, so don't use it for anything you can't redo. Its entries are grouped under Experimental: fleet below.

Behaviour change: sandboxes run as the host user by default (identity = "host"). The config's remoteUser (else containerUser, else the image's USER) is adopted with your host uid/gid, keeping its name, home and shell. A config that assumes root in the container (mounts or paths under /root, a root remoteUser/containerUser) can break under it, so run, start and rebuild now offer to update it first (the dashboard asks too), and identity = "image" keeps the old behaviour. Existing instances keep the user they were created with until rebuilt (devsandbox rebuild --force <name>).

[sandbox.legacy]
identity = "image"   # users as written, no remapping

Machines added with 0.8.0 must be added again with machine add: their old links are refused (see Experimental: fleet).

Added

  • Sandboxes run as the host user, planned per runtime mode. run probes the runtime's user-namespace mode (rootful, rootless docker, rootless podman, VM-backed) once per runtime context, picks how to create and exec the container so the adopted account ends up with your ids, and prints the plan in one line (identity: rootful: exec as vscode, remapped to 1000:1000) plus any warning. On rootless docker, where root is the host user, execs run as root with HOME set to the account's home. With no account to adopt, the sandbox runs as root with a warning recommending the common-utils feature. A docker socket mount gets the right group, and SELinux-enforcing hosts get their binds relabelled. --reprobe on run and rebuild probes the mode again.
devsandbox run web --reprobe
  • identity config field. identity = "host" (default) or "image" (users taken literally, as before). When it's unset, updateRemoteUserUID = false means "image", so devcontainer configs that opt out of uid remapping keep doing so.

  • Updating configs that mount into /root. Before run, start and rebuild, on a terminal, devsandbox lists the config entries that break under host identity and asks [u]pdate / [c]ontinue as is (don't ask again) / [s]kip this time. Update rewrites the config file in place, comments and layout kept: /root becomes ${containerEnv:HOME}, a root user is removed (or kept with identity = "image"), and it names the instances that now need a rebuild. A YAML config gets the edits to make by hand. Off a terminal, under run --json and from autostart, run prints one warning line instead. The dashboard flags these sandboxes in its header (N sandboxes use /root (U to update)) and Detail panel, and offers the same update when it opens, on U, and before run, start and rebuild. Machines' configs are checked on the machine. API: config.findings, config.migrate, config.ack (docs/reference/api.md, Config).

  • ${containerEnv:NAME}. Resolves at create, once the image is built, from the sandbox's containerEnv, else the image's ENV, else for HOME the home of the account the container runs as. It works in mounts, shell-rc, feature mounts, containerEnv and remoteEnv, so a mount can land in the user's home whoever that is, and PATH = "${containerEnv:PATH}:/opt/bin" extends the image's PATH.

mounts = ["source=${sharedVolumes}/gh,target=${containerEnv:HOME}/.config/gh,type=bind"]
  • Browsers keep their sandbox. Docker sandboxes are created with devsandbox's seccomp profile: docker's default plus user namespaces for unprivileged processes, which Chromium's and Electron's own sandbox needs (podman already allows it). That opens kernel surface docker's default closes; userns = false keeps docker's default profile. Where execs run as root (rootless docker, root images), chrome, chromium and google-chrome go through a wrapper that starts the real browser at a non-root uid; DEVSANDBOX_CHROME (and CHROME_PATH, CHROME_BIN, PUPPETEER_EXECUTABLE_PATH) point at it, so a Playwright script passes executablePath: process.env.DEVSANDBOX_CHROME and chromiumSandbox: true. Root plans also silence pip's and bundler's root warnings.
[sandbox.web]
userns = false
  • Tools are told whether a browser sandbox works. Each new container checks whether a browser sandbox can start there, and run says so (browser sandbox: on, or off (<why>); sandbox-off knobs set). Where it works, every exec gets DEVSANDBOX_BROWSER_SANDBOX=1; where it doesn't, the tools' sandbox-off knobs (PUPPETEER_DANGEROUS_NO_SANDBOX, ELECTRON_DISABLE_SANDBOX, QTWEBENGINE_DISABLE_SANDBOX, PLAYWRIGHT_MCP_SANDBOX=false, CHROMIUM_FLAGS=--no-sandbox). Keys you set in containerEnv or remoteEnv win. inspect prints the verdict; instances created before this say not recorded until rebuilt.

  • Resumable exec sessions. On an instance with the helper, a tty exec runs in a session that outlives the client: if the terminal or connection goes, the program keeps running, and exec --attach gets back to it (the one detached session, a pick list when there are several, or --attach=<id>). --sessions lists them, --session <id> runs in a named one, attaching if it's live. Dashboard terminals run in sessions too, so a shell closed with the dashboard can be reattached from the CLI; the Detail panel shows sessions: N (M detached) and the row a ▣N badge. Ended sessions are cleaned up after a few minutes; detached ones stay until removed.

devsandbox exec web --sessions
devsandbox exec web --attach
devsandbox exec web --attach=1790000000-a1b2
  • Machine terminals reconnect. A tty exec on a machine's instance, and a dashboard terminal tab on one, reattach to their session when the connection drops (connection lost, reconnecting… (Ctrl-C to stop), backing off up to 10 s), instead of ending the program's terminal. To keep the connection's own failure apart, a program there that exits 255 reports 254.

  • exec --service <name> opens a terminal in a service container the instance uses (its command, else a login shell).

Fixed

  • Feature mounts under ${sharedVolumes} work on a first run. A feature's bind mount whose source is under ${sharedVolumes} is now created when missing, like a config mount, instead of skipped with a warning. Other missing feature sources are still skipped.
  • caches work for a non-root user. Cache mounts now go to /var/cache/devsandbox/<name> instead of /root/…, which a non-root remoteUser couldn't reach. The tools find them through their env vars as before.
  • Same-named sandboxes in two config roots no longer clobber each other's images, nor does sandbox foo-feat clobber sandbox foo's features image. Built images are tagged per config root, one prefix per kind (devsandbox-img-<root>-<sandbox>, devsandbox-feat-<root>-<sandbox>, devsandbox-img-svc-<root>-<service>), so the first run or rebuild after upgrading builds them again; images under the old tags are left for docker image prune.
  • ${localEnv:NAME:default} uses its default. An unset NAME now expands to default (everything after the :) instead of empty; a set one, even to empty, to its value. ${containerEnv:NAME:default} works the same.
  • Running devsandbox as root on rootful docker or podman works. Instead of failing to remap the adopted account to uid 0, execs run as root with HOME set to the account's home, as on rootless docker.
  • The dashboard's build log follows a running build, refreshing within about 100 ms instead of only on snapshots.
  • Dashboard prefills no longer fail as ambiguous. r's prefill and tab completion, and p's port prefills, write a local name a machine also has as @/<name>, so the line submits.
  • Machines' rows stay current. A late update from a machine could bring back a root that was dropped, or overwrite a newer snapshot with older rows.
  • A signal no longer fails a command talking to the host daemon. An interrupted read of the daemon's reply is retried instead of failing the command.

Experimental: fleet

Everything in this group may change between releases (commands, member.toml, the fleet's files next to state.toml, the protocol between machines) with no migration. Don't use it for anything you can't redo.

  • One link per pair of machines, under the machine's trust. Everything done on a machine (CLI commands, verbs, terminals, port forwards, the ssh agent) rides one held link instead of an ssh connection per use; ssh carries only that link and machine add's probe. Links from before this release are refused until both ends have keys and a signed member list, so add 0.8.0 machines again. What a link reaches is the machine's own machine trust (worker by default): a machine you drive freely needs machine trust full there.

  • Machines form one fleet around a hub. machine add joins fleets: the machine joins this host's fleet, this host joins the machine's, or (neither in one) the two start one with this host as hub, --hub making the target the hub instead; two different fleets are refused. A laptop joins an ...

Read more

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 15:12

Machines: sandboxes on your other hosts, over ssh, in the same CLI and dashboard, with your ssh-agent relayed only where you allow it. No more half-built sandboxes: an instance is recorded from the moment run starts, a failure leaves it listed as failed with its error, and Ctrl-C undoes the whole run. Every run, rebuild and start keeps a build log, and the dashboard runs them in the background instead of handing them the screen. run, rebuild, start, stop, rm and service rebuild now run in the host daemon, so a build outlives the terminal that started it, and -d leaves it running. The dashboard gets everything it shows from the daemon too.

Behaviour change: a failed run now leaves an instance to rm. Before, only a failing lifecycle command (postCreateCommand, …) kept its container, and a run that failed earlier (worktree, image build, container create) left its worktree, branch and services behind with no instance pointing at them. Now every failure keeps a failed instance; devsandbox rm <name> removes all of it, or devsandbox rebuild <name> retries.

devsandbox rebuild web-4   # retry a failed run
devsandbox rm web-4        # or remove everything it made

Added

  • machine add installs devsandbox on the machine. When the machine has no devsandbox or another version, machine add offers to copy this one there (to ~/.local/bin/devsandbox, or over the old one); --auto-install skips the question and is needed off a TTY. A devsandbox in ~/.local/bin is found even when the machine's login shell doesn't put it on PATH. devsandbox --version prints the version.
devsandbox machine add me@my-server --auto-install
  • Machines: sandboxes on other hosts, over ssh. devsandbox machine add <ssh target> registers a host running devsandbox (its config roots are offered to pick from, or pass --config '<path there>'); machine ls shows each one's state, machine rm forgets it. Their sandboxes and instances then show in the dashboard next to yours, in a MACHINE column, and every key works on them, terminals included. On the CLI a name is looked up on every machine: one match is used wherever it is, my-server/test or @/test (this host) picks when it's ambiguous. Verbs run on the machine with its login shell's environment. Your ssh-agent reaches a machine only if you ask: machine add --agent, machine set <name> --agent on|off, or a on the dashboard's Machines tab (5, listed while a machine is registered: each machine's target, link state, agent and version) (off by default, takes effect at once), relayed by devsandbox rather than ssh -A. A login shell that prints a banner no longer makes the machine unreachable. exec, logs, inspect, done and rename run there over ssh. --machine <name> runs a command without a name there (ps, ls, stop --all, …). A machine that's down keeps its last rows, marked unreachable. Not yet on machines: VS Code, the Inbox. Adding a machine means trusting it. Details: docs/machines.md.
devsandbox machine add me@my-server
devsandbox run api              # `api` is only defined on my-server
devsandbox exec test            # an instance there: over ssh
devsandbox stop my-server/test  # qualified, when `test` exists here too
  • Port forwards into a machine's sandboxes. devsandbox port my-server/web 3000 opens a port of an instance on a machine on this host, and port --machine my-server --service redis 6379 one of its global services. In the dashboard, p on a machine's row does the same; the Ports tab lists those forwards with a MACHINE column, and like local ones they're kept by the host daemon and come back after it restarts. Each forward is tunnelled over your own ssh to the machine, reconnecting if it drops. A machine's forwardPorts stay on that machine: forwards into it are only the ones you ask for here. The machine needs this devsandbox version. Details: docs/architecture/daemon/forwards.md, Remote bridges.
devsandbox port my-server/web 3000
devsandbox port --machine my-server --service redis 6379
  • Forwards show the listening process without lsof. The process listening on a forwarded port (node (pid 412)) now comes from the in-container helper, so it shows in images that have no lsof, and on a machine's forwards too. Running instances pick up the new helper when restarted.

  • API: forwards into machines. forwards.add takes machine (the forward still binds on this host; dir is the config root there), forwards.list takes machines: true to include them, and forward rows carry machine. Details: docs/reference/api.md, Forwards.

  • API: machines. machines.probe|add|list|get|rm, roots.list, a machine param that runs a quick call or a verb on a machine, machines: true on instances.watch (rows tagged machine, plus each machine's link state), instances.resolve and sandboxes.list (every machine's matches), and found on instances.resolve's answer. Details: docs/api.md, Machines.

  • -d / --detach on run, rebuild and start. Returns as soon as the instance is registered and prints its name (run -d --json: the run record); the build goes on in the host daemon. Follow it with devsandbox logs --build <name> --follow, or watch its row in the dashboard.

devsandbox run -d web --branch fix/login
  • API: the verbs as methods. run, rebuild, start, stop, rm and services.rebuild stream their output and phase over the API, plus instances.resolve, instances.cancel and sandboxes.list. Details: docs/api.md, Verbs.

  • API: everything the dashboard shows. instances.list takes a depth (disk, listing or full, to skip the runtime or just its stats) and also answers thread_children. New: instances.procs and instances.signal (an instance's processes and tracked runs; SIGTERM/SIGKILL one), instances.buildLog, instances.rename, instances.done, containers.logs and containers.inspect (devsandbox containers only), sandboxes.get and services.get (a config as written and resolved). instances.changed now also fires when an instance is created, removed, renamed, marked done or changes step. Details: docs/api.md.

  • API: instances.watch. A client watching a config root gets its snapshot pushed as instances.snapshot every 2 s (cpu/mem every 7 s), from one poll shared by every watcher; the dashboard uses it, so two dashboards cost the runtime no more than one. stop, rm and services.rebuild take detach (a hang-up leaves them running), run, rebuild and start take tty (run on a pty of that size), and instances.buildLog takes ansi (keep the colours). Details: docs/api.md.

  • status --json and ls --json sandbox rows gain dispatcher and worktree_branch: whether the sandbox is a dispatcher, and its resolved worktree-branch. Details: docs/json-output.md.

  • Build logs. run, rebuild and start write their whole output, the containers' build and lifecycle commands included, to a log per instance (~/.local/share/devsandbox/logs/<instance id>/build.log; the one before is kept as build.1.log, and rm deletes both). devsandbox logs --build <name> prints it; --follow keeps printing until the instance is done building. The command's error, if it failed, is the last line. Builds run on a terminal of their own when you're on one (or start them from the dashboard), so docker's progress display and colours show as they used to, live and in the dashboard's build log (b), which also scrolls with the mouse wheel. Piped, logs --build prints plain text.

devsandbox logs --build web-4 --follow
  • ps, status --json and the dashboard show where an instance is. While it's being made, an instance's status is its step (preparing, building, creating, then the lifecycle command running, like postCreateCommand), and failed when it stopped partway; the dashboard's Detail panel shows the failed step and error. status --json rows carry it as phase ({"state": "in-flight", "step": "building"} or {"state": "failed", "step": …, "error": …}), absent once the instance is ready; ps --json rows of instances with a container too. Details: docs/json-output.md.

Changed

  • run, rebuild, start, stop, rm and service rebuild run in the host daemon. The command starts devsandbox serve if needed, hands it the work and prints its output as it comes, exiting as before. Closing the terminal, or losing the ssh session, no longer stops a build; Ctrl-C still cancels it (the rollback's output shows, exit 130), and a second one stops it at once. Prompts (the sandbox picker, an ambiguous name, rm's branch question) still happen in your terminal. If no daemon answers, one warning: line and the command runs in your terminal as before (on Windows it always does, with no daemon).

  • The dashboard is a client of the host daemon. Everything it shows comes from devsandbox serve and every action goes to it, so it needs the daemon (it starts one when it opens, as before). If the daemon goes away, the last tree stays on screen marked stale with the reason, and actions say the daemon is needed. On Windows, which has no daemon, the dashboard isn't available for now. It no longer runs an autostart pass of its own when it opens; the daemon's covers every config root that has instances.

  • The dashboard no longer takes over the screen for stop, rm or a service's rebuild. They run in the daemon, and the status line says how they ended, or why not (e.g. rm refusing a dirty worktree). rm's question about deleting the branch is a y/n popup; esc removes nothing. Quitting the dashboard while one of them is still going leaves it running.

  • s on a stopped instance starts it like devsandbox start. It used to be a bare container start; it now al...

Read more

v0.7.1

Choose a tag to compare

@github-actions github-actions released this 13 Oct 13:57

Critical fix: upgrade if you run more than one instance of the same repo. A git worktree prune or git gc inside one sandbox could delete git's records of every other instance's worktree, leaving them with fatal: not a git repository. devsandbox now locks the worktrees it creates. After upgrading, run devsandbox start once on each existing instance to lock its worktree (safe on a running one), and devsandbox rebuild it to also get the git gc guard. This release also adds local-folder features and fixes a few host-daemon start and shutdown issues.

devsandbox start <instance>

Added

  • Local-folder features. A features key starting with ./, ../ or / is a feature folder (devcontainer-feature.json + install.sh) resolved against the config dir, so a config can ship its own feature without publishing it to a registry. Options, containerEnv, installsAfter, mounts, privileged and entrypoint work as for OCI features. Editing a file in the folder marks the sandbox's instances as drifted, so devsandbox rebuild picks the change up, and devsandbox ls warns when the folder or its devcontainer-feature.json is missing.
[template.base.features."./features/toolkit"]
ripgrep = true

Fixed

  • Critical: git worktree prune inside a sandbox no longer breaks the other instances' worktrees. A container sees the repo's worktree records but not the other checkouts, so a prune (or git gc) there deleted their records and left each one with fatal: not a git repository. devsandbox now locks the worktrees it creates, so prune and gc skip them; existing instances get locked on their next start. An instance whose record was already pruned gets a warning on start instead; git won't work in it until the record is restored. Containers also get gc.worktreePruneExpire=never (after a rebuild for existing ones), so git gc leaves worktrees you made yourself alone too. Details: docs/worktree-locking.md.
  • devsandbox rebuild starts the host daemon, like run and start. A rebuilt dispatcher or inbox = true instance with no dashboard open and no daemon running had no host, so its devsbd control commands exited 75 until some other command started one.
  • An upgrade or devsandbox serve shutdown no longer brings back the old daemon. A dispatcher's child op still running while the daemon shut down could start a fresh daemon from the old binary, which then kept running instead of the new one (or undid the shutdown).
  • The "no host connected" error says how to get one. Control commands that exit 75 now suggest running any devsandbox command (or devsandbox serve install) instead of opening the dashboard, which no longer serves them.
Commits
  • 6a9f65a chore(site): add pnpm shot to screenshot built pages
  • 029b3ac fix(site): tidy the architecture diagrams' joins and index list
  • 23ba27b docs(changelog): note the serve drain race and no-host hint fixes
  • 5f1d597 docs(changelog): note that rebuild now starts the host daemon
  • 8c2b83e docs(devsbd): point the no-host hint at the daemon, not the dashboard
  • 2977de1 fix(serve): never lazy-start a daemon from a dispatcher child op
  • 138d46b fix(rebuild): start the host daemon after a rebuild
  • 7ae7921 fix(worktree): lock sandbox worktrees so a prune inside a container can't break the others
  • 454e99e docs(site): add unlinked /architecture pages for contributors
  • 002dda3 docs(features): document local-folder features
  • fc97df0 feat(features): support local-folder features

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 12 Oct 14:47

A per-user host daemon now keeps notifications, dispatchers and port forwards working with the dashboard closed, and serves an API that editors, GUIs and the new npm connect() client can drive. Sandboxes can keep one Inbox thread per item: a header with a state and buttons, and a conversation of messages, forms and your replies, answered from the dashboard, the new devsandbox inbox command or any API client, with events streamed back as they happen. The Inbox becomes a list of what's waiting on you rather than a log, and instances can be marked done instead of removed. VS Code can open straight at a file and line.

Added

  • A host daemon keeps devsandbox live with the dashboard closed. devsandbox serve is a per-user background process that now owns the connection to every running sandbox's helper: the ssh-agent relay, notifications and desktop popups, dispatcher control commands and port forwards. You don't start it: the dashboard, run, start and the commands that relay your ssh-agent start it when needed, and it exits 10 minutes after its last user left (a dashboard, a forward, a running dispatcher or inbox = true sandbox). A newer devsandbox takes over from an older daemon by itself. devsandbox serve install runs it from login as a systemd user unit (Linux) or a LaunchAgent (macOS), for sandboxes the container runtime restarts on boot; an upgrade repoints the installed unit at the new binary, and serve uninstall removes it. To keep it from idling without a unit, use devsandbox serve --keep-alive or ~/.local/share/devsandbox/daemon.config.toml. exec, start and run no longer start an ssh-agent bridge of their own: one bridge per container, relaying the agent of whichever session last ran a command. Details: docs/serve.md.
# ~/.local/share/devsandbox/daemon.config.toml
[serve]
keep-alive = true
devsandbox serve install
  • Port forwards outlive the dashboard. Ports-tab forwards and every sandbox's forwardPorts now run in the host daemon, so closing the dashboard no longer drops them, and every open dashboard shows the same ones. Forwards you add are saved in ~/.local/share/devsandbox/forwards.toml and come back on the same host port after a daemon restart or a reboot, until d stops them. devsandbox port still forwards in the foreground until you stop it.

  • Inbox threads. A sandbox that declares inbox = true can keep one thread per item in the Inbox (a PR, an email to answer). devsbd thread put sets its header: a title, a link, a state (needs-you, active or done), a status, the child instance it's about, up to 9 buttons and an optional reply box (compose, with a hint line under it saying what sending does). A put that changes nothing is ignored (no unread mark, no popup), so a sandbox can simply re-send all its threads on every pass; a desktop popup only fires when a thread enters needs-you, and state and status changes show as one-line markers in the thread. devsbd thread send adds a message under the header: markdown and key/value fields blocks, identified by an id of your choosing, so re-sending the same message is free and sending changed content edits it in place; devsbd thread withdraw takes one back. Everything is queued like notify, so it works with no daemon running. devsbd thread rm drops a thread, devsbd thread ls [--feed] lists yours back, messages included. dispatcher alone only grants the child commands, so a dispatcher that wants threads declares both. A rejected put or send shows up as an error notification from your instance, with the reason. Full reference: docs/automations-guide.md.

[sandbox.pr-dispatcher]
dispatcher = { spawn = ["web"] }
inbox = true
devsbd thread put --json '{"key":"pr-123","title":"#123 fix login","state":"needs-you","status":"review replies","child":"pr-123","actions":[{"id":"retry","label":"Retry"},{"id":"done","label":"Done","done":true}],"compose":{"hint":"Starts a run with your message"}}'
devsbd thread send --json '{"thread":"pr-123","id":"run-1","blocks":[{"type":"markdown","text":"Addressed 3 of 4 comments, **1 needs your call**."}]}'
  • Forms in messages. A message can carry a form: choice, text and yes/no questions, with defaults (a text default is how you offer a draft for editing). The dashboard pins open forms under the thread's header: tab between questions, space to pick, e to edit a text answer, enter to see what will be sent and enter again to submit. Half-filled answers are saved as you go, so they survive a restart and show the same in every dashboard. Submitting sends one submit event with every answer, defaults filled in, and the thread shows what you answered (you answered "<title>" over each label: value) where you'll read the owner's reply to it. A question can follow up another (under), shown indented under it, and only be asked while one of its options is picked (when): a reply text that only matters for "Post the reply" is hidden, not required and sent as null when you pick "Don't reply".

  • devsandbox inbox answers threads from a shell. ls and show (with --json) read the Inbox without the daemon; reply, act, submit, done and reopen answer a thread, named <owner>/<key> or by the id ls shows. The owner gets the same events as from the dashboard.

devsandbox inbox ls --view needs-you
devsandbox inbox reply pr-dispatcher/pr-123 "Rebase it first"
  • An API for editors and GUIs. The host daemon serves a JSON-lines API on a unix socket: the Inbox (threads, replies, actions, forms, done/reopen, notifications), instances, port forwards, and change notifications. devsandbox api --stdio relays it over stdin/stdout for clients that can only spawn a process; it exits 0 when its input ends and 75 only when the daemon hung up first. The npm package's connect() wraps it with typed inbox, instances and forwards methods and events. Whoever can open the socket can act as you on every sandbox, like docker.sock. Reference: docs/api.md.
const api = await devsandbox.connect({ name: 'my-tool' });
await api.subscribe(['inbox']);
const [t] = await api.inbox.list('needs-you');
  • Thread buttons that act right away. A button can carry a built-in host action that runs in the dashboard with no round trip: open VS Code on the thread's child (at a file and line), a terminal, its logs, a port forward, a link, or rm with the usual confirm. On a stopped child, VS Code, the terminal and the forward start it first (the button says (stopped)); logs don't, since a stopped container's log says why it stopped. The target is always the thread's child or the thread's owner itself, never another instance, and there is no arbitrary host command.

  • Events: your answers, back to the thread's owner. Every other button, a reply, a form submission, marking a thread done and reopening it become events the owner reads with devsbd events (JSON lines, each naming its thread). --wait SECS returns as soon as there's one; --follow keeps a stream open and prints each event the moment it happens, with a ping after 30 s of quiet, and a newer follower from the same instance replaces the older one, so two copies of a loop never both act on a click. --thread KEY narrows either to one thread. Delivery is at least once: events stay until the owner acks them with devsbd events ack <id>… after saving its own state. devsbd features lists the newer verbs a helper has (thread-send, events-follow, …), so a script can check before using them.

devsbd events --follow
devsbd events ack e-1790900001-3f2a
  • Done instances. An instance marked done keeps its container, worktree and runs, and shows dimmed with a ✓ in the dashboard and (done) in ps, until you remove it. Mark it with devsandbox done <instance>, a thread's Done, or a dispatcher's devsbd done <key>; clear it with devsandbox undone, u on the thread, or a dispatcher's ensure reusing it. devsbd ls, ps --json and status --json report done. npm: done(name) / undone(name), and done on instance rows.
  • d removes the selected instance in the dashboard. Like s, it acts right away with no prompt: it runs rm, which still refuses a dirty worktree and asks before deleting the branch.
devsandbox done web-pr-123
  • devsandbox vscode --goto opens VS Code at a file and line. The path is relative to the instance's workspace folder. It opens (or focuses) the window as before, then has the in-container helper open the file in that window, waiting up to 30 s for it to attach; if that fails, the window still opens and the output says why the line was dropped. In the dashboard: :code <instance> --goto path:line.
devsandbox vscode web-2 --goto src/main.rs:42:7
  • Select and copy text with the mouse in the dashboard. Drag in any pane to select text inside it, without borders or the panes next to it. Releasing copies it to your clipboard (copy on select, on by default); with that setting off, ctrl-shift-c or cmd-c copies it, and so does ctrl-c over a selection, for terminals that send that key plain or keep ctrl-shift-c for their own copy (Alacritty, GNOME Terminal, kitty and most Linux terminals: there the dashboard tells you ctrl-c). The copy goes through your terminal (OSC 52), so it works over SSH and from a container; under tmux, enable allow-passthrough. Inbox threads copy as rendered, with bullets, quotes, tables and links as shown and wrapped lines joined back, and dragging past the edge scrolls so a long message copies whole; the config, help and logs views work the same way. shift-drag still gives your terminal's own selection. In the integrated terminal, apps that use the mouse (vim, tmux, zidane) now get your clicks, drags and hover, and what they copy to the clipboard now reaches yours (a setting turns tha...
Read more

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 12:20

The config file is now devsandboxes.toml, and it can be written in YAML too; an existing config.toml is renamed for you. Extra folders get their own worktree when someone else owns the checkout, rm --force clears out stuck instances, dispatchers can see which branches are in use, and the dashboard opens instantly and keeps its Inbox across restarts while putting far less load on dockerd.

Added

  • YAML configs. devsandboxes.yaml (or .yml) works in place of devsandboxes.toml: same keys, extends merging and validation, only the syntax differs. A sandbox hashes the same in either format, so converting a config doesn't mark instances for rebuild. Keep one config file per config dir; with more than one, devsandbox stops with an error.
sandbox:
  web:
    folder: ../web
    image: mcr.microsoft.com/devcontainers/base:ubuntu
    services: [database]
  • devsbd branches <sandbox> tells a dispatcher which branches are already checked out. It prints a JSON list of every branch in a worktree of the sandbox's repo and who holds it: one of the dispatcher's own children, another instance, the base checkout, or a worktree devsandbox doesn't know. It reads git on the host each time, so a git switch inside an instance is seen. With --ahead, each row also gets the number of commits origin doesn't have yet, and local branches that are ahead but not checked out are listed too. A dispatcher can use it to leave alone PRs that someone is working on locally. The sandbox must be in the dispatcher's spawn. Running dispatchers pick up the new helper when restarted.
devsbd branches web --ahead
  • rm --force (-f) removes an instance whatever state it's in. A worktree with uncommitted or untracked changes is removed anyway, changes discarded, instead of rm refusing. A step that fails (a worktree git won't remove, a repo the host refuses to run git in) prints a warning and rm carries on, so the instance still leaves the list. Whatever couldn't be removed stays on disk. The branch of a worktree that was left in place is kept. In the dashboard: :rm --force <instance>. npm: rm(name, { force: true }).
devsandbox rm --force web-2
  • The dashboard's Instances tree has a TYPE column when a sandbox is a dispatcher. Instances of a dispatcher sandbox read dispatcher, the others -. Without any dispatcher in the config the column isn't shown.

Changed

  • The config file is now devsandboxes.toml. An existing config.toml is renamed the next time devsandbox runs in its config dir (with a notice on stderr), and is read as-is until then. A config.toml with no sandbox, template or services table isn't a devsandbox config and is left alone.

  • Inbox times say how long ago a notification came in. The TIME column reads just now, 12s ago, 5 min ago, 3h ago, 1 day ago, … 6 days ago, then the date and time (Oct 2 14:32) once a notification is a week old. Before, it showed only the time of day, so yesterday's notifications looked like today's. The Detail pane shows the date and time.

  • folders entries get their own git worktree when the checkout belongs to someone else. If an extra folder is a git repo and it's another sandbox's folder, or another instance already mounts it, the instance now gets a worktree of it, detached at that checkout's HEAD. Before, the instance mounted the live checkout, so the owner switching branches changed what the instance saw. The worktree is kept across rebuild and removed by rm. Dispatcher children always get one. To keep the old live view for an entry, write it as a table with worktree = "never", or use "always" to force a worktree:

[sandbox.web]
folder = "../web"
folders = { "/workspaces/api" = "../api", "/workspaces/.shared" = { path = "../.shared", worktree = "never" } }
  • A sandbox's own folder now also gets a worktree when another instance mounts that folder directly as a folders entry.

  • The Inbox keeps its history. Notifications are saved in inbox.toml next to state.toml, so they survive closing the dashboard; d/D remove them from the file too. A notification with the same --key no longer replaces the earlier one: it becomes the head of a thread, with the older ones folded under it (→ to show them). With more than one instance sending, the Inbox groups them per instance, foldable like the Instances tree. The limit is now 200 notifications per instance (was 50, and 200 overall).

  • worktree-link no longer migrates old shared-files/<sandbox>/ stores. The automatic move only relinked the instance being run, so every other instance on the same repo was left with dangling links. A link into an old store is now skipped with a warning that shows where the file should go. Move it there, delete the old link, and rebuild.

  • The dashboard opens instantly and fills in as the runtime answers. The tree is drawn from state.toml and the config right away, statuses (… until then) arrive with the first container listing, and CPU/MEM after that. Before, the dashboard waited about 1.5s for docker stats and showed "no sandboxes defined" meanwhile.

  • The dashboard puts much less load on dockerd. CPU/MEM now refresh every 7s instead of every 2s (statuses still every 2s), the runtime version is asked once, and process lists are only fetched while the Instances tab is open. Instance drift is read from the container listing instead of two docker inspects per instance.

Fixed

  • Listing containers no longer makes dockerd compute their disk sizes. Every ls, ps, gc, autostart pass and dashboard refresh asked for container sizes as a side effect of the output format, which spiked dockerd's CPU every 2s while the dashboard was open and made each listing take ~300ms instead of ~20ms.

  • Opening VS Code no longer clears an instance's extensions. devsandbox vscode and the dashboard's o read the sandbox config from the current directory, not from the instance's own config directory. Run from anywhere else, the extensions list was rewritten as empty, so VS Code didn't install anything. They now read the instance's own config. If that config still can't be read, the list is left as it was. Instances already hit by this get their list back the next time you open VS Code from the new version.

  • An rm that failed partway can be retried. A worktree an earlier rm had already removed made the next rm fail too; it is now pruned instead.

  • The dashboard no longer warns about mount sources run creates itself. shared-volumes paths and per-instance mount sources that don't exist yet are made by run, so a sandbox with no instance no longer shows them as problems.

  • VS Code labels the primary workspace root by its folder name, matching the extra folders roots, instead of the instance name.

Commits
  • 3a63926 feat(config): read devsandboxes.toml (or .yaml/.yml) and rename a legacy config.toml, so the config file is recognizable on its own and can be written in yaml
  • b25563f feat(tui): show inbox times as how long ago, then date and time after a week, so older notifications don't pass for today's
  • 16e793a feat(tui): accept --force on the :rm prompt so the dashboard can remove instances the cli's rm --force can
  • 2b0bb63 feat(npm): let rm pass --force so node callers can remove instances with uncommitted changes or failed teardown steps
  • 647b127 feat(rm): add --force so an instance can be removed despite uncommitted worktree changes or failed teardown steps
  • aa50d82 docs(changelog): note the dashboard startup, dockerd load and type column changes
  • 3aacc06 perf(tui): collect stats every 7s, ask the runtime version once and fetch processes only on the instances tab to cut idle dockerd load
  • bff0cf7 perf(docker): list containers with an explicit ps template so the cli stops asking dockerd to compute every container's disk size
  • fe376b0 perf(tui): render the tree from state and config before asking the runtime, and read instance drift from ps labels instead of two inspects per instance
  • 376bdb6 fix(tui): show the tree right away on startup instead of a false 'no sandboxes' message while docker stats samples
  • 092958d fix(tui): size the services column to its content when type is shown so the type column sits beside it, not at the far edge
  • 8dcbfd2 fix(tui): stop warning about shared-volumes and per-instance mount sources that run creates before any instance exists
  • b0ad91f feat(tui): add a type column to the instances tree so dispatcher instances stand out from the ones they spawn
  • e7239b9 fix: update changelog and cleanup plan
  • 20d8f6a docs(dispatch): document devsbd branches in the automations guide, design and changelog so dispatcher authors know to check branch holders before acting
  • f2a9e43 feat(devsbd): expose the branches op as devsbd branches [--ahead] so dispatcher scripts can call it
  • 985f9ef feat(dispatch): add a read-only branches control op so a dispatcher can see which branches are checked out, and unpushed, before touching a PR
  • 1a723d4 docs(dispatcher): plan a devsbd branches op so dispatchers can tell which branches are in use
  • 2a485c4 fix(vscode): resolve extensions from the instance's config root and keep the registered ones when it can't be resolved, so opening from another directory no longer wipes them
  • 11081b9 feat(tui): persist the inbox and thread keyed notifications per instance
  • f655b58 fix(vscode): label the primary workspace root by its directory name, so it matches the extra folders instead of showing the instance name
  • 3975498 fix(rm): prune instead of remove a worktree a previous rm already removed, so an rm that failed later can be retried
  • deb0e1a fix(config): hash folders tables that restate the default like the plain string, so moving an entry to the table form isn't drift
  • c2acba2 docs(folders): document per-entry ...
Read more

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 30 Sep 13:52

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 first devsandbox 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 needs podman-restart.service enabled. On Apple container it behaves like true. Changing autostart never marks an instance as drifted; the next start applies it in place.
[sandbox.triage]
folder = "../triage"
autostart = "runtime"   # or true
  • Boot hook: new containers run devsbd boot on every start, which brings back the helper daemon and, in runtime mode, postStartCommand (output in /run/devsandbox/boot.log). Containers created before this need devsandbox rebuild --force to 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, enter opens an http(s) link, d/D dismiss) 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 dispatcher can manage child instances through devsbd, 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-instances defaults to 10 and counts stopped children too.
    • --branch accepts plain branch names only ([A-Za-z0-9._/-]) and is used literally, with no ${…} expansion.
    • --env refuses 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 a devsandbox rebuild of the child, including when ensure recreates a missing container. On an existing child, ensure --env replaces the saved values, and every command devsandbox runs in the child (exec, dashboard terminals, devsbd exec runs, lifecycle commands) uses them from then on, over a same-named remoteEnv; 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 exec are tracked in the child (id, log, exit status). Follow them with devsbd run ls|logs|wait, clean them up with devsbd run rm (--force kills a running one) and devsbd run prune --keep N; the TUI shows a child's last runs under its processes.
  • devsbd is on PATH in containers (/usr/local/bin/devsbd).
  • forwardPorts: while the dashboard is open it forwards each running instance's configured ports to 127.0.0.1, the same way devsandbox port does (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); d stops 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 two null without 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 -i nor -t given it runs with -i, plus -t when 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 spawning devsandbox exec yourself (node-pty, child_process.spawn) without shell quoting.
  • rm --delete-branch / rm --keep-branch answer the "delete branch?" question without prompting, so scripts and other callers without a TTY can clean up the branch run created. --delete-branch deletes it like answering yes (git branch -D, so unmerged commits go too); --keep-branch keeps it. Branches run reused rather than created are always kept. With neither flag, rm still asks on a TTY and keeps the branch otherwise. npm: rm(name, { deleteBranch }), where true / false pass --delete-branch / --keep-branch.
  • Docs site at devsandboxes.com: a quick start, a playable tour of the dashboard, the full config.toml reference, the Node API reference, ten worked examples (parallel coding agents, shared and per-instance services, package caches, ssh-agent and git push, babysitting pull requests, porting a devcontainer.json, …), full-text search (⌘K / Ctrl+K) and this changelog.

Changed

  • Worktrees reuse existing branches. run --branch X, and a dispatcher's devsbd ensure --branch X, no longer fail when X exists:

    • a local X is checked out as it is;
    • an X that only exists on origin (a PR head, for example) becomes a local branch tracking origin/X, so a plain git push updates it;
    • a branch that's already checked out somewhere else gives an error saying where.

    rm only offers to delete branches devsandbox created itself.

  • New containers use sh -c '… devsbd boot & exec sleep infinity' as their command instead of sleep infinity, so images need /bin/sh.

  • start sets the container's restart policy from autostart, 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 --json instance rows include instance_id and, for children, dispatcher.

  • rebuild applies worktree-include. Before, adding a pattern marked instances as drifted, but the rebuild copied nothing. Now rebuild copies 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 ports entry 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 web and web-2, devsandbox exec web (and rm, stop, logs, …) now means the instance web instead 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. exec now 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(...)).name for the old value. It calls run --json, so build and autostart output can no longer end up as the "name".

Fixed

  • rm on a dirty worktree no longer leaves an instance without its container. rm removed the container, volumes and services first, then git worktree remove refused 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 like less and man get ↑/↓. Shells still scroll their history.
  • *...
Read more

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 28 Sep 09:07

Worktree instances can now bring along the gitignored files a repo needs to run, like .env files, instead of starting without them.

Added

  • Copy gitignored files into new worktrees. A repo's .worktreeinclude file is always honored, and worktree-include adds more patterns (gitignore syntax). Matching untracked files are copied from the base checkout into each new worktree and never overwrite existing files.
  • Share gitignored files across all instances. Each worktree-link path is moved to one shared copy under shared-files/<sandbox>/, and every worktree gets a symlink to it. An edit in one instance shows up in all of them. This also works on Apple container, which can't bind single files. Globs work within one path segment (* / ?), and a leading ./ is accepted.
[sandbox.web]
folder = "../web"
worktree-include = ["fixtures/*.local.json"]   # copied once, per worktree
worktree-link = [".env", "packages/*/.env"]    # one live copy shared by every instance
  • A CHANGELOG.md, which is also used as the GitHub release notes.

Fixed

  • TUI: pressing s to start an instance refreshes the list shortly afterwards, so the new state appears right away.
Commits
  • 52da316 docs(changelog): readable release notes with examples, written ahead of release via a release skill
  • 9dff820 docs(changelog): backfill changelog and generate it on release so github releases carry notes
  • c6925a0 feat(run): one-segment globs and leading ./ in worktree-link
  • ebd7200 feat(run): carry gitignored files into worktrees via copy or shared link
  • d836a5a fix(tui): when start is pressed, refresh instance list after 500ms
  • 7005680 chore(ci): fix warnings reported