Reclaim disk space by cleaning development artifacts
A powerful, interactive CLI tool that helps developers reclaim disk space by identifying and safely removing common development artifacts like node_modules, build outputs, caches, Docker volumes, and more.
Features β’ Installation β’ Usage β’ Documentation β’ Contributing
- π― Smart Detection - Automatically finds 20+ common dev artifacts across multiple languages and tools
- π Visual Interface - Beautiful, interactive TUI for easy directory selection
- π³ Docker Support - Detects and cleans Docker volumes from docker-compose files
- π Flexible Filtering - Filter by size, depth, custom patterns, or exclude specific directories
- π‘οΈ Safety First - Multiple validation layers to prevent accidental deletions
- β‘ Fast Scanning - Parallel processing for quick results even on large projects
- π¨ Color Coded - Category-based color coding for easy identification
- πΎ Size Analysis - See exactly how much space each directory uses
npm install -g clean-stack-clinpx clean-stack-cli scan- Node.js 18.0.0 or higher
# Scan current directory
clean-stack-cli scan
# Scan specific directory
clean-stack-cli scan ~/projects
# Scan with size filter
clean-stack-cli scan --min-size 100MB
# Include Docker volumes
clean-stack-cli scan --docker-volumesOnce scanning completes, use these keyboard shortcuts:
| Key | Action |
|---|---|
β β |
Navigate through list |
Space |
Toggle selection |
A |
Select all |
D |
Deselect all |
Enter |
Confirm and delete |
Q / Esc |
Quit without deleting |
Scan a directory for cleanable artifacts.
Options:
--min-size <size>- Filter out directories smaller than specified size (e.g.,100MB,1GB)--max-depth <depth>- Maximum directory depth to scan (default:10)--include <patterns...>- Custom patterns to include (e.g.,"build" "dist" "*.tmp")--ignore <patterns...>- Patterns to ignore (e.g.,"important-cache" "keep-this")--docker-volumes- Include Docker volumes from docker-compose files
Examples:
# Clean up large artifacts
clean-stack-cli scan ~/projects --min-size 500MB
# Custom patterns only
clean-stack-cli scan --include "tmp" "*.backup" "old-*"
# Exclude specific directories
clean-stack-cli scan --ignore "node_modules" "important-dist"
# Docker projects
clean-stack-cli scan ~/docker-projects --docker-volumes
# Combine filters
clean-stack-cli scan --docker-volumes --min-size 1GB --max-depth 5List all built-in patterns that will be scanned.
clean-stack-cli listnode_modules- npm/yarn/pnpm dependencies.pnpm- pnpm storebower_components- Bower dependenciesvenv,.venv,env,virtualenv- Python virtual environments
dist,build,out- Distribution and build directories.next- Next.js build output.nuxt- Nuxt.js build outputtarget- Rust/Maven build output
.cache- Generic cache directories.parcel-cache- Parcel bundler cache.turbo- Turborepo cache.pytest_cache,__pycache__- Python caches.eslintcache- ESLint cache
coverage- Code coverage reports.nyc_output- NYC coverage outputhtmlcov- Python coverage HTML reports
.terraform- Terraform cache
When using --docker-volumes flag:
- Local bind mounts from docker-compose files
- Relative volume paths (e.g.,
./data,./logs) - Only volumes within the scanned directory
CleanStack includes multiple safety mechanisms:
- Path Validation - Only deletes within the scanned directory
- System Directory Protection - Prevents deletion of system paths
- Explicit Confirmation - Requires user selection and confirmation
- No Symlink Following - Doesn't follow symbolic links during deletion
- Error Handling - Gracefully handles permission errors and continues
- Docker Volume Safety - Only includes existing local bind mounts
- Docker Volume Scanning - Comprehensive guide for Docker volume detection
- Examples - Real-world usage examples and patterns
- Contributing - Guide for contributors
- Changelog - Version history and updates
git clone https://github.com/huantt/clean-stack-cli.git
cd cleanstack
npm install
npm linkcleanstack/
βββ src/
β βββ scanner/ # Directory scanning and pattern detection
β βββ ui/ # Interactive terminal UI
β βββ cleaner/ # Deletion logic
β βββ utils/ # Utility functions
βββ bin/ # Executable entry point
βββ tests/ # Test files
npm testContributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
- π§ͺ Testing - Help add automated tests
- π Documentation - Improve guides and examples
- π¨ UI/UX - Enhance the interactive experience
- π Patterns - Add support for more artifact types
- π Localization - Add multi-language support
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Commander.js for CLI framework
- Powered by Ink for beautiful terminal UIs
- Uses fast-glob for efficient file scanning
- 20+ patterns detected out of the box
- 5 categories (dependencies, build, cache, coverage, infrastructure)
- Docker support for containerized projects
- Zero config needed to get started
If you find CleanStack useful, please consider giving it a star on GitHub!
Made with β€οΈ by developers, for developers
Report Bug β’ Request Feature β’ Documentation
