Share feedback
Answers are generated based on the documentation.

sbx env rm

DescriptionRemove a sandbox environment and its scoped resources
Usagesbx env rm [PATH...] [flags]

Experimental

This command is experimental.

Experimental features are intended for testing and feedback as their functionality or design may change between releases without warning or can be removed entirely in a future release.

Description

Remove the sandbox declared in sbxenv.yaml along with the secret values provisioned at its sandbox scope (service, custom, and registry credentials). Global credential bindings are left in place by default since they are user-wide and may be shared with other sandboxes; pass --prune-bindings to also remove the bindings this environment declares.

Each PATH may be a directory (the file is /sbxenv.yaml) or the path to the environment file itself. Passing more than one PATH deep-merges them in order (docker-compose -f semantics), so the same set used to create the environment resolves to the same sandbox on removal.

A directory PATH selects sbxenv.yaml; a file PATH selects that file. With no PATH, ~/.sbxenv.yaml supplies shared defaults when present. Explicit PATHs skip those defaults. Later files override earlier values; lists such as ports and mcp.servers are concatenated.

Options

OptionDefaultDescription
--env-argexperimental Value for an argument the environment file declares, as name=value (can be repeated)
--env-args-fileexperimental File of name=value environment arguments, one per line (can be repeated); --env-arg overrides
-f, --forceSkip confirmation prompts and delete even if in use (e.g. an open SSH connection)
--nameName for the sandbox, overriding 'name:' in sbxenv.yaml and the derived <agent>-<directory> (every 'sbx env' command addressing this environment needs the same value)
--prune-bindingsAlso remove this environment's bindings from the global credentials.yaml
--skip-host-commandsSkip host preRemove commands and disable owned host MCP commands; successful environment removal deletes their registrations

Global options

OptionDefaultDescription
--cloudDispatch to Docker Cloud Sandboxes API instead of local sandboxd (supported by a growing set of verbs — run 'sbx --cloud --help' for the current list)
-D, --debugEnable debug logging

Examples

sbx env rm

# Also remove the credential bindings the environment created
sbx env rm --force --prune-bindings ./project