Reclaim gigabytes in seconds. A blazingly fast Rust CLI with a beautiful TUI for analyzing and cleaning disk space. Automatically detects 60+ temporary directory patterns across Node.js, Python, Rust, Java, and more.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Disk Cleanup Tool - Interactive Mode (โฅ1 MB) โ
โ Total: 156 dirs | Size: 2.3 GB | Selected: 3 (450 MB) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโ Directories (5/156) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [ ] ๐ /home/user/projects/app1/node_modules - 450 MB โ
โ [โ] ๐ /home/user/projects/app2/.venv - 120 MB โ
โ [โ] ๐ /home/user/projects/app3/build - 89 MB โ
โ [ ] ๐ /home/user/projects/app4/target - 78 MB โ
โ [โ] ๐ /home/user/Downloads - 45 MB โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- ๐ Fast - Parallel scanning with real-time progress
- ๐ฏ Smart - Detects 60+ patterns:
node_modules,.venv,target, caches, and more - ๐ฅ๏ธ Beautiful - Modern TUI with colors, icons, vim-style navigation
- ๐ก๏ธ Safe - Explicit confirmation, detailed previews, error resilience
- ๐ Flexible - CSV export/import for analysis and batch operations
- ๐จ Focused - Smart 1 MB filter shows only directories worth cleaning
# Clone and build
git clone https://github.com/yourusername/disk-cleanup-tool.git
cd disk-cleanup-tool
cargo build --release
# Or use Make
make build
make install # Installs to ~/.cargo/binRequirements: Rust 1.70+ | Works on macOS, Linux, Windows
# Scan and clean interactively
disk-cleanup-tool --path ~/projects --interactive
# Show only temp directories
disk-cleanup-tool --path ~/projects --temp-only
# Export to CSV for later
disk-cleanup-tool --path ~/projects --output-csv scan.csvLaunch the beautiful TUI to browse, select, and delete directories:
disk-cleanup-tool --path ~/projects --temp-only --interactive| Key | Action | Key | Action |
|---|---|---|---|
โ/โ j/k |
Navigate | Space |
Toggle selection |
PgUp/PgDn |
Jump 10 | a |
Select all |
Home/End |
Jump to top/bottom | c |
Clear all |
d |
Delete selected | q Esc |
Quit |
- ๐ Color-coded - Temp dirs highlighted, normal dirs in different color
- [โ] Visual selection - Checkboxes show what's selected
- ๐ Real-time stats - Total size, selected count, space to free
- โก Smooth scrolling - Responsive navigation through thousands of entries
- ๐ฏ Smart filter - Shows only dirs โฅ1 MB (hides 92% of noise, keeps 96%+ of reclaimable space)
60+ patterns across 10+ ecosystems using exact name matching:
node_modules โข bower_components โข .npm โข .yarn โข .pnpm-store โข .next โข .nuxt โข .output โข .turbo โข .parcel-cache โข .webpack โข .rollup.cache โข .vite โข .vercel โข .netlify
.venv โข venv โข env โข .env โข __pycache__ โข .pytest_cache โข .mypy_cache โข .tox โข .eggs โข *.egg-info โข .ipynb_checkpoints
target โข .fingerprint โข .cargo
dist โข build โข out โข _build โข .build โข .gradle โข .mvn
.cache โข cache โข .tmp โข tmp โข temp โข .temp โข .sass-cache โข .docusaurus
.nvm โข .rvm โข .rbenv โข .pyenv
.idea โข .vscode โข .vs โข .eclipse โข .settings
coverage โข .coverage โข .nyc_output โข htmlcov
.DS_Store โข Thumbs.db โข .Trash
Detection Strategy: Exact name matching only (node_modules โ
| my_node_modules โ) prevents accidental deletion.
disk-cleanup-tool --path ~/old-projects --temp-only --interactivedisk-cleanup-tool --path ~/projects --temp-only | grep node_modules# Export scan results
disk-cleanup-tool --path ~/projects --output-csv scan.csv
# Review CSV, then clean interactively
disk-cleanup-tool --input-csv scan.csv --temp-only --interactive# Full scan with all directories
disk-cleanup-tool --path ~/projects --output-csv full_scan.csv
# Filter and clean specific types
disk-cleanup-tool --input-csv full_scan.csv --interactiveSave scans for later review or batch processing:
# Export
disk-cleanup-tool --path ~/projects --output-csv results.csv
# Import and clean
disk-cleanup-tool --input-csv results.csv --interactiveCSV Format:
path,files,size_bytes,type
/home/user/projects,150,2048576,normal
/home/user/projects/node_modules,5420,524288000,temp- โ Explicit confirmation - Must type "yes" to delete
- ๐ Detailed preview - Shows all directories and total size
- ๐ Error resilience - Continues if some deletions fail
- ๐ Clear reporting - Success/failure status for each operation
- ๐ฏ Conservative matching - Exact names only, no wildcards
- ๐พ CSV backup - Export before cleanup for safety
30 tests with 100% property coverage:
cargo test # Run all tests
make test # Using Make
cargo test -- --nocapture # With outputCoverage:
- 12 unit tests for core functionality
- 18 property-based tests (proptest) for correctness
- Tests for scanning, CSV, deletion, and UI logic
Built with modern Rust tools:
- Ratatui 0.29 - Beautiful TUI framework
- Crossterm 0.28 - Cross-platform terminal
- Clap 4.5 - CLI parsing
- Rayon 1.10 - Parallel processing
- csv 1.3 - CSV handling
- proptest 1.5 - Property-based testing
- โก Parallel directory traversal
- ๐พ Efficient size calculation with caching
- ๐ชถ Minimal memory footprint
- ๐ฌ Smooth 60 FPS UI rendering
- ๐ฆ Handles thousands of directories effortlessly
The release process automatically bumps the version, updates Cargo.toml, and creates a GitHub release:
# Patch release (0.1.0 -> 0.1.1)
make release
# Minor release (0.1.0 -> 0.2.0)
make release BUMP=minor
# Major release (0.1.0 -> 1.0.0)
make release BUMP=majorThis will:
- Bump version in Cargo.toml
- Update Cargo.lock
- Commit the version bump
- Build release binary
- Create GitHub release with auto-generated notes
- Upload platform-specific archive
GitHub Actions automatically builds multi-platform binaries when you push a tag:
- Linux x86_64
- macOS x86_64 + ARM64 (Apple Silicon)
- Windows x86_64
See scripts/README.md for details.
Contributions welcome! See CONTRIBUTING.md for guidelines.
Ideas for improvement:
- Additional temp directory patterns
- Search/filter in interactive mode
- Directory tree view
- Configurable size threshold (
--min-sizeflag) - More export formats (JSON, YAML)
- Undo/redo for selections
- CHANGELOG.md - Version history
- CONTRIBUTING.md - Contribution guidelines
- scripts/README.md - Release scripts documentation
Why does interactive mode only show directories โฅ1 MB?
To focus on meaningful cleanup. In typical projects:
- 92% of directories are < 1 MB (only 4% of total space)
- 8% of directories are โฅ 1 MB (96% of total space)
This filter removes noise while keeping almost all reclaimable space visible. Use non-interactive mode to see everything.
Is it safe to delete these directories?
Most detected directories are safe to delete and can be regenerated:
node_modules- Runnpm install.venv- Recreate withpython -m venv .venvtarget- Rebuild withcargo build- Caches - Automatically regenerated
However: IDE settings (.idea, .vscode) contain your preferences. Review before deleting!
Can I add custom patterns?
Yes! Edit src/utils.rs and add your pattern to the is_temp_directory() function:
pub fn is_temp_directory(name: &str) -> bool {
matches!(
name,
"node_modules" | "target" | "your_pattern" | // ...
)
}Then run tests and update documentation.
How do I see all directories, not just โฅ1 MB?
Use non-interactive mode or export to CSV:
# Print all directories
disk-cleanup-tool --path ~/projects
# Export all to CSV
disk-cleanup-tool --path ~/projects --output-csv all.csvMIT License - see LICENSE for details.
If this tool saved you disk space, give it a โญ on GitHub!
Made with โค๏ธ and Rust | Report Bug | Request Feature