Share feedback
Answers are generated based on the documentation.

sbx prune

DescriptionRemove all stopped sandboxes
Usagesbx 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 since=DURATION to narrow the set to sandboxes that have been stopped for longer than DURATION (e.g. since=168h to keep 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 what would be removed without removing anything.

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.

Local-only: cloud sandboxes expire via their TTL.

Options

OptionDefaultDescription
--dry-runList the sandboxes that would be removed without removing them
--filterFilter candidates (supported: since=DURATION — stopped for longer than DURATION)
-f, --forceSkip confirmation prompts and remove even if in use (e.g. an open SSH connection)

Global options

OptionDefaultDescription
-D, --debugEnable debug logging