Loading...
Loading...
Use this skill when authoring, planning, or running a declarative `sbxenv.yaml` file for Docker Sandboxes (`sbx env create/run/plan/exec/rm`), even if the user just says they want to "check in a sandbox config", "make onboarding reproducible for a sandbox", "run a setup script before the agent starts", or "define arguments for a shared sandbox environment". Covers the sbxenv.yaml schema (schemaVersion, agent, kits, workspace/additionalWorkspaces, args, env, secrets, registries, bindings, mcp, ports, sandboxOptions), host `lifecycle:` commands (initialize/postCreate/preRemove) and their approval-plan model, multi-file merge (`-f`-style deep merge and the user-level `.sbxenv.yaml` base layer), and file-write-protection (`sandboxOptions.writableEnvFiles`).
npx skill4agent add docker/skills docker-sandboxes-envsbxenv.yaml"1"sbx env create|run|plan|exec|rmkits:sbx createsbx runargs:--env-argsbx env createrunsbx createrunrmsbxenv.yamldocker-sandboxes-lifecycledocker-sandboxes-network-credentialssecrets:registries:bindings:spec.yamlkits:docker-sandboxes-kitssbx envsbxenv.yaml.sbxenv.yamlschemaVersion: "1"agent:kits:agent: shellsbx env create|run|plan|exec|rmPATHPATH<PATH>/sbxenv.yamldocker compose -fsbx env create sbxenv.yaml override.yaml.sbxenv.yamlname:--namename:--namename:workspace:sbx createworkspace:workspace:workspace: .${{ env.projectDir }}PATH${{ env.fileDir }}$PATH: $PATH:/opt/binworkspace: . # mounts the directory this file sits in
# workspace: ${{ env.projectDir }} # mounts the project directory explicitlyworkspace:docker-sandboxes-kitssbx env planPATH.sbxenv.yamlPATHname:workspace:${{ env.projectDir }}args:args:defaultdefault: ""required: truedescriptionenumpattern${{ env.args.NAME }}--env-arg NAME=VALUE--env-args-file PATHlifecycle:lifecycle:initializecreaterunpostCreatepreRemovesbx env rmsbx env execpreRemovesbx env execsbx env createsbx env runlifecycle:
initialize:
- command: test -d app || git clone https://github.com/acme/app
postCreate:
- command: ./scripts/seed-fixtures.sh
preRemove:
- command: ./scripts/archive-state.shworkdir:timeout:sbx settings set env.rememberHostCommands truerememberHostCommands--skip-host-commandssbx env plan [PATH...]sbx env createsbx env run--auto-approve-y-yvalue:sha256:ref:command:secrets:registries:sbx secret setsbx env rmvaluerefcommandsbx secret setdocker-sandboxes-network-credentialsbindings:credentials.yamlsecrets:registries:sbx env rm--prune-bindingssbxenv.yamlref:command:value:secrets:# OPTIONAL fragment — add only if this environment actually needs a
# credential; the minimal asset omits this entirely.
secrets:
anthropic:
ref: op://Private/Anthropic/api-key # never a literal `value:` in a checked-in file
refresh: 55mkits:additionalWorkspaces:mcp:ports:sandboxOptions:kits:agent:workspace:additionalWorkspaces:workspace:sbxenv.yamlsbx run:romcp.servers:sbx env rmports:sbx ports --publishsbx env rmsandboxOptions:writableEnvFilessbx createtemplatememorycpuspullPolicyprofileskillsreferences/env-schema-fields.mdsandboxOptions.writableEnvFilessandboxOptions.writableEnvFiles: truesbx env plansbx createrunrmdocker-sandboxes-lifecyclesecrets:registries:bindings:docker-sandboxes-network-credentialsspec.yamlkits:agent:docker-sandboxes-kitsreferences/sources.mdreferences/env-schema-fields.mdkits:additionalWorkspaces:mcp:ports:sandboxOptions:assets/sbxenv.yamlshellchecks/verification.md--app-name