feat(cli): beautify forkd images + add forkd rmi <tag>#139
Merged
Conversation
Two polish items on snapshot management:
1. \`forkd images\` table output revamped:
- new columns: MEMORY (memory.bin size) and CREATED (relative age)
- dynamic TAG column width
- sorted most-recent-first instead of alphabetical
- footer with snapshot count + total bytes
Before:
TAG SIZE ROOTFS?
coding-agent-fork-prewarm-v1 2.4 GiB yes
After:
TAG SIZE MEMORY CREATED ROOTFS
coding-agent-fork-prewarm-v1 2.4 GiB 512.0 MiB 3d ago yes
python-numpy 1.8 GiB 512.0 MiB 12h ago yes
2 snapshots · 4.2 GiB total
2. New \`forkd rmi <TAG>...\` subcommand (docker-style):
- tries DELETE /v1/snapshots/:tag first (clean: daemon removes
registry entry + on-disk files atomically)
- falls back to direct disk removal when the daemon is unreachable
or doesn't know the tag (404)
- reports source per tag: \"(daemon)\", \"(disk)\", or
\"(disk (daemon unreachable))\"
Examples:
forkd rmi pyagent
forkd rmi pyagent langgraph python-numpy
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
329f5d6 to
e1ff849
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two snapshot-management polish items.
1. `forkd images` table revamped
Before:
```
TAG SIZE ROOTFS?
coding-agent-fork-prewarm-v1 2.4 GiB yes
```
After (live on dev box, 65 snapshots, 41.75 GiB total):
```
TAG SIZE MEMORY CREATED ROOTFS
branch-sb-6a0e9444-0027-1779340356 512.0 MiB 512.0 MiB 1h ago —
speculative-1779338575690 512.0 MiB 512.0 MiB 2h ago —
cli-diff-test 512.0 MiB 512.0 MiB 12h ago —
...
65 snapshots · 41.75 GiB total
```
Changes:
2. New `forkd rmi ...` subcommand (docker-style)
```
$ forkd rmi probe-5-1779263791772987781 probe-6-1779263795516612417
✓ probe-5-1779263791772987781 (daemon)
✓ probe-6-1779263795516612417 (daemon)
$ forkd rmi nonexistent-tag
✗ nonexistent-tag (snapshot nonexistent-tag not found (no daemon entry, no disk dir at ...))
Error: 1 of 1 removals failed
```
Files
Total: 167 insertions, 6 deletions.
🤖 Generated with Claude Code