Documentation Index
Fetch the complete documentation index at: https://docs.celesto.ai/llms.txt
Use this file to discover all available pages before exploring further.
Synopsis
Description
Thecleanup command removes stale or auto-created VMs and their associated resources. By default, it targets VMs with the vm- prefix and any VMs that have been reconciled as stale.
Options
Delete all VMs, not just stale or auto-created ones.
Auto-VM prefix to clean. Only VMs starting with this prefix (or marked as stale) will be targeted.
Print targets without deleting. Useful for previewing what would be cleaned up.
Skip the confirmation prompt and delete the targeted VMs without asking. Required when running non-interactively (no TTY) or together with
--json.Confirmation prompt
Because cleanup permanently deletes VMs, the command lists the targeted IDs and asks you to confirm before doing anything:y or yes to proceed. Anything else — including pressing Enter — aborts cleanly with exit code 0 and no VMs are deleted.
Use --force to skip the prompt in scripts or CI. Without --force, smolvm cleanup refuses to run in two cases to avoid silently destroying data:
- You passed
--json(machine-readable output, no interactive prompt possible). - Standard input is not a TTY (for example, piped or redirected).
1 and prints an error telling you to add --force.
--dry-run never deletes anything, so it does not prompt or require --force.
Examples
Clean auto-created VMs (default prefix)
Remove VMs with IDs starting withvm- and any stale VMs:
Skip the prompt in scripts
Use--force (or -f) when you are running cleanup non-interactively and have already decided to delete everything:
--force with --json for automation pipelines:
Preview cleanup targets
See what would be deleted without actually deleting:Clean VMs with custom prefix
Remove VMs starting with a custom prefix:Delete all VMs
Cleanup Process
The cleanup command performs the following steps:- Reconciliation: Identifies stale VMs (VMs with state entries but no running processes)
- Target Selection: Based on
--allor--prefix, selects VMs to delete - Resource Cleanup: For each target VM:
- Stops the VM process (if running)
- Removes TAP network devices
- Cleans up nftables rules
- Removes state database entries
Exit Codes
| Code | Description |
|---|---|
0 | Success — all targets cleaned, or user declined at the confirmation prompt |
1 | Partial failure, or refused to run unattended without --force (no TTY, or --json mode) |
Standalone Command
The cleanup command is also available as a standalone script:smolvm cleanup.
Related Commands
smolvm doctor- Diagnose system setup before cleanup
