Skip to content

Add bbox cache subcommand for image cache management#88

Merged
JAORMX merged 2 commits intomainfrom
add-bbox-cache-subcommand
Mar 24, 2026
Merged

Add bbox cache subcommand for image cache management#88
JAORMX merged 2 commits intomainfrom
add-bbox-cache-subcommand

Conversation

@JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Mar 24, 2026

Summary

  • Add bbox cache list — show cached images with digest, size, last-used time, and referencing image refs
  • Add bbox cache gc [--dry-run] — reachability-based GC removing orphaned rootfs entries
  • Add bbox cache purge [--force] — remove the entire image cache directory
  • Bump go-microvm to v0.0.25 (adds Cache.List, Cache.GC, Cache.Purge)

Closes #84

Example output

$ bbox cache list
DIGEST              SIZE      LAST USED      IMAGE
sha256:a1b2c3d4...  1.2 GB    2 hours ago    ghcr.io/stacklok/brood-box/claude-code:latest
sha256:c3d4e5f6...  800 MB    5 days ago     (orphan)

Entries: 2 (1 orphan) | Rootfs: 2.0 GB | Layers: 500 MB | Total: 2.5 GB

$ bbox cache gc --dry-run
would remove sha256:c3d4e5f6... (800 MB)

1 entries, 800 MB would be freed

$ bbox cache gc
Removed 1 unreferenced cache entries

Test plan

🤖 Generated with Claude Code

JAORMX and others added 2 commits March 24, 2026 11:17
Add `bbox cache` with three subcommands:

- `bbox cache list` — show cached images with digest, size, last-used
  time, and which image refs point to each entry
- `bbox cache gc` — remove rootfs entries not referenced by any image
  ref (supports --dry-run)
- `bbox cache purge` — remove the entire cache directory (requires
  --force or interactive confirmation)

Bump go-microvm to v0.0.25 which adds the List, GC, and Purge methods
to image.Cache.

Closes #84

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.0.26 fixes legacy ref files showing as orphans in cache list
and gc --dry-run incorrectly reporting referenced entries as
removable. Also fixes errcheck lint warnings in cache.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX merged commit 71abb34 into main Mar 24, 2026
8 checks passed
@JAORMX JAORMX deleted the add-bbox-cache-subcommand branch March 24, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bbox cache CLI subcommand for image cache management

1 participant