The ultimate disk reclamation tool for Rust developers.
cargo-mop is a high-performance, recursive cleaning utility that deep-scans your filesystem to find and mop up bloated target directories. It's designed to be fast, safe, and beautiful.
- Parallel Mop: Turbocharge cleanup using
rayon-powered multi-threading. - Recursive Discovery: Deep-scans directory trees while intelligently identifying Workspace roots.
- Selective Clean: Choose exactly what to sweep with an elegant Interactive TUI.
- Ghost Hunter: Detect and report orphaned
targetdirectories (whereCargo.tomlis missing). - Stale Analysis: Pinpoint "dusty" projects by cross-referencing Git history and filesystem metadata.
- Disk Health Insight: Real-time disk usage rating to visualize your reclamation impact.
- Temporal Filtering: Target only the old stuff with precise duration filters (e.g.,
--older-than 2w). - Flexible Exclusions: Support for glob patterns and
.mopignorefor surgical precision. - Registry Deep-Clean: Optionally wipe the global
~/.cargo/registrycache to free up gigabytes.
- Agent Friendly: Full
--jsonsupport for seamless integration with AI Agents and scripts. - Headless Mode: Automatic TTY detection for clean, log-friendly output in non-interactive environments.
cargo install cargo-mopStandard Mop:
cargo mopFast Mop (Parallel):
cargo mop --parallel --jobs 4Interactive Mop:
cargo mop --interactiveClean Old Projects (older than 30 days):
cargo mop --older-than 30dAgent/Automation Mode:
cargo mop --json > result.json| Option | Description |
|---|---|
--find-ghosts |
Detect orphaned target directories with no parent project. |
--stale-analysis 6m |
Analyze projects that haven't been touched in 6 months. |
--registry |
Deep clean the global ~/.cargo/registry cache. |
--exclude "*kernel*" |
Skip projects matching specific glob patterns. |
--no-bell |
Disable the completion sound. |
Licensed under either of Apache License, Version 2.0 or MIT license at your option.