| 内容説明 | Remove all stopped sandboxes |
|---|---|
| 利用方法 | sbx prune [flags] |
Description
Remove all stopped sandboxes and their associated resources.
Only stopped sandboxes are candidates — a running sandbox is never removed, which makes this safe to run habitually. Stop a sandbox first with "sbx stop" if you want it pruned. To remove a specific sandbox regardless of state, use "sbx rm SANDBOX".
Use --filter until=TIMESTAMP to narrow the set to sandboxes that stopped before TIMESTAMP. The value can be an RFC 3339 timestamp, Unix timestamp, or Go duration relative to now (e.g. until=168h keeps anything stopped within the last week). A sandbox whose stop time the daemon cannot report is left alone, since how long it has been stopped cannot be established.
Use --dry-run to list the sandboxes that would be removed without deleting anything. Add --format json or --format yaml for machine-readable output.
Pruning requires confirmation; use --force to skip the confirmation prompt (for non-interactive scripts) and to remove a sandbox that is in use (e.g. an open SSH connection). This action cannot be undone.
When the Runtime backend is off, pruning also removes images from deleted sandboxes if nothing else needs them. Run prune again to retry failed image cleanup. Unrelated images are left alone. Secrets scoped to each deleted sandbox are also removed.
Local-only: cloud sandboxes expire via their TTL.
Options
| オプション | デフォルト | 内容説明 |
|---|---|---|
--dry-run | List the sandboxes that would be removed without removing them | |
--filter | Filter candidates (supported: until=TIMESTAMP — stopped before TIMESTAMP) | |
-f, --force | Skip confirmation prompts and remove even if in use (e.g. an open SSH connection) | |
--format | Output format: table, json or yaml | |
--json | Output in JSON format |
Global options
| オプション | デフォルト | 内容説明 |
|---|---|---|
--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) | |
-D, --debug | Enable debug logging | |
--no-input | Never prompt; commands that need an answer fail with the command to run instead |
Examples
# Show what would be removed
sbx prune --dry-run
# Remove without asking
sbx prune --force
# Only sandboxes stopped before a point in time
sbx prune --filter until=2026-01-01T00:00:00Z