The problem
Every repo needs a slightly different toolchain: this one Node 22, that one Rust, all of them gh. Maintaining a Dockerfile per repo for that is busywork, and the devcontainer ecosystem already packages each tool as a Feature.
devsandbox installs Features natively, without the devcontainer CLI: list them under features with the same references and options as in devcontainer.json.
Look at my current devsandbox config and suggest devcontainer Features where they make sense.
- Read the devsandbox-cli and config-toml-spec skills first (load them if they are installed, otherwise read them from https://github.com/Nemikolh/devsandboxes/tree/main/skills). Follow them over your own assumptions: unknown config keys are hard errors.
- Find my devsandbox config dir: the folder holding devsandboxes.toml, passed to devsandbox as
-C <config dir>. If you cannot tell which one, ask me. - Find toolchains installed by Dockerfiles, lifecycle commands or heavy images that an official Feature could provide. List each suggestion and what it replaces, and apply only the ones I pick.
- Validate with
devsandbox -C <config dir> lsand fix every error it reports before going on. - Ask me before anything destructive: devsandbox rm, gc, rebuild --force, service rebuild, deleting files or branches.
<…> fill in before sending Agent skills (opens in a new tab)
Config
devsandboxes.toml
[template.base]
image = "mcr.microsoft.com/devcontainers/base:ubuntu" # plain Ubuntu, no toolchain
features = { "ghcr.io/devcontainers/features/github-cli:1" = true } # gh everywhere, default options
[sandbox.web]
extends = "base"
folder = "../web"
features = { "ghcr.io/devcontainers/features/node:1" = "22" } # a string sets the `version` option
[sandbox.api]
extends = "base"
folder = "../api"
features = { "ghcr.io/devcontainers/features/rust:1" = { profile = "minimal" } } # or a table of optionsTry it
TERMINAL
devsandbox run web # fetches the Features, builds the image
devsandbox run web --name fix-login # its own worktree, same toolchain
devsandbox exec fix-login node --version # v22.x
devsandbox exec fix-login gh --version--name: the instance name.
Change a Feature, say node "20", and apply it:
TERMINAL
devsandbox rebuild fix-login # drifted: recreated with node 20How it works
- Features are baked into an image derived from
imageorbuild,devsandbox-img-<sandbox>-feat; OCI references only (features). featurestables merge key by key underextends:webgets gh and node (templates).= falseskips a Feature, e.g. one inherited from a template.- Adding, removing or changing a Feature makes existing instances drift;
devsandbox rebuildapplies it (drift).
Source: site/src/content/examples/features.mdxEdit this page on GitHub(opens in a new tab)