cua cache
See and reclaim the disk used by images, sandboxes, builds and logs.
See and reclaim the disk used by images, sandboxes, builds and logs.
| Command | Description |
|---|---|
cua cache ls | List what the SDK keeps on disk, one row per image, sandbox, build output, install archive or log. |
cua cache du | Disk usage per category, the cache budget and free space. |
cua cache prune | Reap orphaned ephemeral sandboxes, remove orphans (abandoned downloads, unused layers) and evict least-recently-used cache down to the budget. |
cua cache config | Show or set the cache settings ($CUA_HOME/cache.json; the CUA_CACHE_BUDGET, CUA_DISK_MIN_FREE, CUA_DISK_WARN_FREE and CUA_ORPHAN_REAP_MINUTES environment variables win). |
Every command also accepts the global options.
Disk used by images, sandboxes, builds and logs, and its cleanup.
cua cache [OPTIONS] <COMMAND>cua cache ls#List what the SDK keeps on disk, one row per image, sandbox, build output, install archive or log.
cua cache ls [OPTIONS]Alias: cua cache list.
| Flag | Type | Default | Description |
|---|---|---|---|
--category | string | Only this category (images, docker-images, lume-bases, builds, installables, icons, sandboxes, checkpoints, logs, data, legacy). |
Examples
cua cache ls
# Only cached images
cua cache ls --category imagescua cache du#Disk usage per category, the cache budget and free space.
cua cache du [OPTIONS]Examples
cua cache du
cua cache du --jsoncua cache prune#Reap orphaned ephemeral sandboxes, remove orphans (abandoned downloads, unused layers) and evict least-recently-used cache down to the budget. Never removes a sandbox or anything one uses.
cua cache prune [OPTIONS]| Flag | Type | Default | Description |
|---|---|---|---|
--budget | string | Budget for this run (auto, off or a size such as 20G). | |
--all | boolean | false | Evict every unused cache entry, not only down to the budget. |
--dry-run | boolean | false | Show what would be removed; remove nothing. |
Examples
# See what a cleanup would remove
cua cache prune --dry-run
# Evict every unused cache entry
cua cache prune --allcua cache config#Show or set the cache settings ($CUA_HOME/cache.json; the CUA_CACHE_BUDGET, CUA_DISK_MIN_FREE, CUA_DISK_WARN_FREE and CUA_ORPHAN_REAP_MINUTES environment variables win).
cua cache config [OPTIONS]| Flag | Type | Default | Description |
|---|---|---|---|
--budget | string | Cache budget: auto (min of 30 GiB and 10% of free space plus cache), off, or a size. | |
--min-free | string | Free space pulls, builds and VM creates always leave (size). | |
--warn-free | string | Warn when free space drops under this (size). | |
--orphan-reap-minutes | integer | Minutes before an ephemeral sandbox whose process died is reaped. | |
--auto-gc | true | false | Clean up automatically after pulls and builds and on daemon idle. |
Examples
# Show the settings
cua cache config
# Cap the cache at 20 GB and keep 10 GB free
cua cache config --budget 20G --min-free 10G| Code | Meaning |
|---|---|
0 | Success. |
1 | Failure, or cua do reported an error. |
2 | Invalid argument, or an ambiguous sandbox name (qualify it: local:NAME, cloud:NAME). |
3 | Not found: sandbox, window, skill or image (or an image not published yet). |
4 | Not supported, or not configured (for example no Fleet credentials). |
5 | No cua-spacesd answered, or a transport failure. |
6 | Unauthenticated or permission denied (by Cua, Fleet or your cloud account). |
7 | Not enough free disk space (see cua cache). |
130 | Cancelled (Ctrl-C during a create): what it made was removed. |