Skip to content

Add empty-trash command, config-file roots, and scan --root - #3

Merged
UnbreakableMJ merged 1 commit into
mainfrom
feature/empty-trash-and-config-roots
Jun 22, 2026
Merged

Add empty-trash command, config-file roots, and scan --root#3
UnbreakableMJ merged 1 commit into
mainfrom
feature/empty-trash-and-config-roots

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

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 the clean → trash → reclaim loop. Dry-run by default (lists items + a lower-bound reclaimable-bytes figure), --apply to purge, --yes/--force for non-interactive use, 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 a structured UNSUPPORTED_PLATFORM error. 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-file roots (TOML) — optional ~/.config/vacuum/config.toml with roots = ["~/projects", …] so default scan directories persist. Precedence: CLI --root/paths > VACUUM_ROOTS env > config roots > $HOME, via a new --config/VACUUM_CONFIG global. vacuum-core stays pure — all config logic lives in vacuum-cli (config.rs). Unknown TOML keys are ignored for forward-compat; an explicitly named missing --config file is a usage error (exit 2).
  • scan --rootscan now accepts --root (merged with positional paths) for parity with list/clean.

Surface & docs

  • schema / describe advertise empty-trash.
  • Texinfo manual: new empty-trash subcommand, --config, and a Configuration chapter (builds zero-warning).
  • AGENTS.md and SKILL.md updated (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 lint compliant · makeinfo zero-warning.
  • Manual end-to-end: dry-run trash listing (purges nothing), config + VACUUM_ROOTS + --root precedence, and --config <missing> → exit 2 all confirmed.

Notes

  • Interactive TUI directory picker was scoped out of this round (deferred to its own ~3–4 day effort).
  • Config is intentionally roots-only for now; the Config struct is left extensible.

🤖 Generated with Claude Code

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>
@UnbreakableMJ
UnbreakableMJ merged commit 38f6896 into main Jun 22, 2026
2 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the feature/empty-trash-and-config-roots branch June 22, 2026 20:14
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.

1 participant