Add empty-trash command, config-file roots, and scan --root - #3
Merged
Conversation
empty-trash: new flat-verb subcommand that permanently empties the OS trash, completing the clean->trash->reclaim loop. Dry-run by default (lists items + lower-bound reclaimable bytes), --apply to purge, --yes for non-interactive, confirmation prompt, live spinner, and the standard JSON/JSONL/Human envelope. Platform-gated via the trash crate's os_limited module (Linux/Windows); other targets return UNSUPPORTED_PLATFORM. Directory sizes are not reported by the backend, so the byte total is shown as a lower bound and the count of uncounted directories is surfaced. config: optional TOML config file for persistent default scan roots (crates/vacuum-cli/src/config.rs). Resolution precedence for the fallback roots is CLI paths/--root > VACUUM_ROOTS env > config 'roots' > $HOME, wired through a new --config/VACUUM_CONFIG global. vacuum-core stays pure; all config logic lives in vacuum-cli. Unknown TOML keys are ignored for forward-compat; an explicitly named missing --config file is a usage error. scan --root: scan now accepts --root (merged with positional paths) for parity with list/clean. Surface + docs: schema/describe advertise empty-trash; the Texinfo manual gains the subcommand, --config, and a Configuration chapter; AGENTS.md and SKILL.md updated. Adds 6 config unit tests and 4 integration tests (39 total). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Three user-requested capabilities for the disk cleaner, plus the agent/doc surface to match.
vacuum empty-trash— a new flat-verb subcommand that permanently empties the OS trash, completing theclean → trash → reclaimloop. Dry-run by default (lists items + a lower-bound reclaimable-bytes figure),--applyto purge,--yes/--forcefor non-interactive use, confirmation prompt, live spinner, and the standard JSON/JSONL/Human envelope. Platform-gated via thetrashcrate'sos_limitedmodule (Linux/Windows); other targets return a structuredUNSUPPORTED_PLATFORMerror. The backend reports no byte size for trashed directories, so the total is shown as "at least …" and the number of uncounted directories is surfaced (item count is always exact).~/.config/vacuum/config.tomlwithroots = ["~/projects", …]so default scan directories persist. Precedence: CLI--root/paths >VACUUM_ROOTSenv > configroots>$HOME, via a new--config/VACUUM_CONFIGglobal.vacuum-corestays pure — all config logic lives invacuum-cli(config.rs). Unknown TOML keys are ignored for forward-compat; an explicitly named missing--configfile is a usage error (exit 2).scan --root—scannow accepts--root(merged with positional paths) for parity withlist/clean.Surface & docs
schema/describeadvertiseempty-trash.empty-trashsubcommand,--config, and a Configuration chapter (builds zero-warning).AGENTS.mdandSKILL.mdupdated (commands, config precedence, env vars).Testing
cargo fmt --check·cargo clippy --workspace --all-targets -- -D warnings·cargo test --workspace(39 pass — 6 new config unit tests, 4 new integration tests) ·reuse lintcompliant ·makeinfozero-warning.VACUUM_ROOTS+--rootprecedence, and--config <missing>→ exit 2 all confirmed.Notes
Configstruct is left extensible.🤖 Generated with Claude Code