sbx rm
| Description | Remove one or more sandboxes |
|---|---|
| Usage | sbx rm [SANDBOX...] [flags] |
Description
Remove one or more sandboxes and all associated resources. Or — with --cloud — the cloud sandbox ID (sbx_*) or name from "sbx --cloud ls".
For local sandboxes, stops them, removes their containers, cleans up any Git worktrees, deletes sandbox state, and deletes secrets scoped to each removed sandbox. This action cannot be undone. With --cloud, deletes the sandbox in Docker Sandboxes Cloud. This action cannot be undone.
Removal requires confirmation; use --force to skip confirmation prompts (for non-interactive scripts) and to delete a sandbox that is in use (e.g. an open SSH connection). Use --all to remove every sandbox. With --cloud, --all is intentionally disabled as a safety gate — the blast radius covers every sandbox the credential can see, which may include shared or production workloads. Pass IDs explicitly in --cloud mode.
Options
| Option | Default | Description |
|---|---|---|
--all | Remove all sandboxes | |
-f, --force | Skip confirmation prompts and delete even if in use (e.g. an open SSH connection) |
Global options
| Option | Default | Description |
|---|---|---|
--cloud | Dispatch to Docker Cloud Sandboxes API instead of local sandboxd (supported by a growing set of verbs — run 'sbx --cloud --help' for the current list) | |
--cloud-api-url | https://api.sandboxes-cloud.docker.com | Cloud Sandboxes API base URL; only used with --cloud. Defaults to prod (https://api.sandboxes-cloud.docker.com). Set DOCKER_CLOUD_API_URL or pass this flag to override; a legacy value ending in /v1 is accepted. |
-D, --debug | Enable debug logging |