deepclean-0.1.0 is not a library.
deepclean ๐งน
A fast, parallel tool to clean Rust projects and remove unused dependencies
Why deepclean?
Rust projects can accumulate gigabytes of build artifacts in target/ directories. When you have multiple projects or workspaces, manually cleaning them is tedious and time-consuming. Plus, unused dependencies bloat your Cargo.toml and slow down builds.
deepclean solves this by:
- ๐ Cleaning multiple projects in parallel - Save time with concurrent cleaning
- ๐ฏ Smart workspace detection - Automatically finds all Cargo projects
- ๐งน Removes unused dependencies - Keep your
Cargo.tomlclean - โก Fast and efficient - Built in Rust for maximum performance
Quick Start
Installation
# Clone the repository
# Install as a cargo plugin
# Now use it!
Note: Make sure ~/.cargo/bin is in your PATH.
Basic Usage
# Clean current directory and all subdirectories
# Clean a specific directory
# Preview what would be cleaned (dry run)
# Only clean projects above 100MB
# Check for unused dependencies
# Remove unused dependencies (automatically checks first)
Features
- โ Parallel processing - Clean multiple projects simultaneously
- โ Smart detection - Uses cargo-metadata for accurate workspace detection
- โ Dependency cleaning - Find and remove unused dependencies (built-in detection)
- โ Size filtering - Only clean projects above a certain size
- โ Progress bars - See what's being cleaned in real-time
- โ Dry-run mode - Preview changes before applying them
- โ Exclude patterns - Skip specific directories
- โ JSON output - Machine-readable output for automation
Options
| Option | Description |
|---|---|
-j, --jobs <N> |
Number of parallel jobs (default: CPU count) |
-e, --exclude <PATTERN> |
Exclude directories matching pattern (can use multiple times) |
--dry-run |
Preview mode (doesn't actually clean) |
--min-size <SIZE> |
Only clean projects above this size (e.g., "100MB", "1GB") |
--clean-deps |
Check for unused dependencies |
--remove-deps |
Remove unused dependencies (requires cargo-remove) |
-v, --verbose |
Verbose output |
--json |
Output results as JSON |
Requirements
- Rust toolchain
- Cargo
Optional: Dependency Removal
To remove unused dependencies, install cargo-edit:
Note: Dependency detection is built-in and doesn't require external tools! The tool parses Cargo.toml and searches your source code to find unused dependencies.
Examples
Clean Everything
Clean Only Large Projects
Find Unused Dependencies
Remove Unused Dependencies
Exclude Specific Directories
Parallel Cleaning with Custom Jobs
How It Works
- Discovery: Recursively finds all Cargo projects using
cargo-metadata - Filtering: Optionally filters by size or exclude patterns
- Cleaning: Removes
target/directories in parallel - Dependency Analysis: Parses
Cargo.tomland searches source code for unused dependencies - Removal: Uses
cargo-removeto clean up unused dependencies
Performance
deepclean is built in Rust for maximum performance:
- Parallel execution across all CPU cores
- Efficient directory traversal
- Minimal memory footprint
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
Apache-2.0