clean-dev-dirs-1.0.0 is not a library.
Visit the last successful build:
clean-dev-dirs-2.0.1
clean-dev-dirs
A fast and efficient CLI tool for recursively cleaning Rust target/
and Node.js node_modules/
directories to reclaim disk space.
๐ Features
- Multi-language support: Clean both Rust (
target/
) and Node.js (node_modules/
) build artifacts - Parallel scanning: Fast directory traversal using multithreading
- Smart filtering: Filter by project size, modification time, and project type
- Interactive mode: Choose which projects to clean with an interactive interface
- Dry-run mode: Preview what would be cleaned without actually deleting anything
- Progress indicators: Real-time feedback during scanning and cleaning operations
- Detailed statistics: See total space that can be reclaimed before cleaning
๐ก Inspiration
This project is inspired by cargo-clean-all, a Rust-specific tool for cleaning cargo projects. I've improved upon the original concept with:
- Multi-language support: Extended beyond Rust to support Node.js projects
- Parallel scanning: Significantly faster directory traversal using multithreading
- Cleaner code architecture: Well-structured, modular codebase for better maintainability
๐ฆ Installation
From Source
Using Cargo
๐ Usage
Basic Usage
# Clean all development directories in the current directory
# Clean a specific directory
# Preview what would be cleaned (dry run)
# Interactive mode - choose which projects to clean
Filtering Options
# Only clean projects larger than 100MB
# Only clean projects not modified in the last 30 days
# Clean only Rust projects
# Clean only Node.js projects
Advanced Options
# Use 8 threads for scanning
# Show verbose output including scan errors
# Skip specific directories
# Non-interactive mode (auto-confirm)
๐ Command Line Options
Option | Short | Description |
---|---|---|
--keep-size |
-s |
Ignore projects with build dir smaller than specified size |
--keep-days |
-d |
Ignore projects modified in the last N days |
--rust-only |
Clean only Rust projects | |
--node-only |
Clean only Node.js projects | |
--yes |
-y |
Don't ask for confirmation; clean all detected projects |
--dry-run |
List cleanable projects without actually cleaning | |
--interactive |
-i |
Use interactive project selection |
--threads |
-t |
Number of threads for directory scanning |
--verbose |
-v |
Show access errors during scanning |
--skip |
Directories to skip during scanning |
๐ฏ Size Formats
The tool supports various size formats:
- Decimal:
100KB
,1.5MB
,2GB
- Binary:
100KiB
,1.5MiB
,2GiB
- Bytes:
1000000
๐ Project Detection
The tool automatically detects development projects by looking for:
- Rust projects: Directories containing both
Cargo.toml
andtarget/
- Node.js projects: Directories containing both
package.json
andnode_modules/
๐ก๏ธ Safety Features
- Dry-run mode: Preview operations before execution
- Interactive confirmation: Choose exactly what to clean
- Intelligent filtering: Skip recently modified or small projects
- Error handling: Graceful handling of permission errors and inaccessible files
๐จ Output
The tool provides colored, human-readable output including:
- ๐ฆ Rust project indicators
- ๐ฆ Node.js project indicators
- ๐ Size statistics in human-readable format
- โจ Status messages and progress indicators
- ๐งช Dry-run previews
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is dual-licensed under either:
- MIT License - see the LICENSE-MIT file for details
- Apache License 2.0 - see the LICENSE-APACHE file for details
You may choose either license at your option.