A fast, interactive TUI tool to find and remove node_modules folders, written in Rust.
- π Smart Scanning - Finds only first-level
node_modules(doesn't traverse into nested ones) - π Size Display - Shows folder sizes and last modified times
- β Multi-select - Select multiple folders for batch deletion
- β‘ Fast - Parallel directory scanning with Rayon
- π¨ Beautiful TUI - Interactive terminal UI with Ratatui
- π₯οΈ Welcome Screen - Run without arguments for an interactive path input
- π Progress Display - Visual progress bar during deletion
cargo install dev-cleanPre-built binaries for Linux, macOS, and Windows are available on the Releases page.
git clone https://github.com/supostat/dev-clean.git
cd dev-clean
cargo install --path .# Launch with welcome screen (enter path interactively)
dev-clean
# Scan specific directory directly
dev-clean /path/to/projects
# Use ~ for home directory
dev-clean ~/ProjectsRun dev-clean without arguments to see the welcome screen with ASCII logo, or provide a path directly.
βββββββ βββββββββββ βββ ββββββββββ ββββββββ ββββββ ββββ βββ
βββββββββββββββββββ βββ βββββββββββ βββββββββββββββββββββ βββ
βββ βββββββββ βββ ββββββββββββ βββ ββββββ ββββββββββββββ βββ
βββ βββββββββ ββββ βββββββββββββ βββ ββββββ ββββββββββββββββββ
ββββββββββββββββ βββββββ βββββββββββββββββββββββββββ ββββββ ββββββ
βββββββ ββββββββ βββββ ββββββββββββββββββββββββββ ββββββ βββββ
- If launched without arguments: Type the path to scan and press
Enter - Supports tilde expansion (
~/Projectsβ/Users/you/Projects)
Navigate through the list of found node_modules folders:
Found 5 node_modules | Total: 1.18 GB | Selected: 0 (0 B)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β βΊ [ ] /Users/dev/projects/app1/node_modules [245 MB] (3d ago) β
β [ ] /Users/dev/projects/app2/node_modules [189 MB] (1w ago) β
β [ ] /Users/dev/projects/old-project/node_modules [512 MB] β
β [ ] /Users/dev/projects/api/node_modules [78 MB] (1d ago) β
β [ ] /Users/dev/projects/website/node_modules [156 MB] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Press
Spaceto toggle selection on current item - Press
ato select all - Press
nto deselect all
- Press
dto delete selected folders - Confirm with
Yor cancel withNin the warning dialog - Watch the progress bar as folders are deleted
| Key | Action |
|---|---|
β / k |
Move up |
β / j |
Move down |
Space |
Toggle selection |
a |
Select all |
n |
Deselect all |
d |
Delete selected |
? |
Show help |
q / Esc |
Quit |
# List all node_modules (no TUI)
dev-clean --list /path/to/projects
# Delete all without confirmation (β οΈ dangerous!)
dev-clean --delete-all /path/to/projects- Rust 1.70+
# Run in development
cargo run -- /path/to/scan
# Run without path (shows welcome screen)
cargo run
# Run tests
cargo test
# Run with hot reload (requires cargo-watch)
cargo watch -x run# Build for current platform
cargo build --release
# Build static binary (Linux)
cargo build --release --target x86_64-unknown-linux-musldev-clean/
βββ src/
β βββ main.rs # Entry point, CLI parsing
β βββ app.rs # App state, selection, scan/delete states
β βββ tui.rs # Event loop, terminal management
β βββ scanner.rs # Directory scanning logic
β βββ ui/
β βββ mod.rs # Screen rendering (list, welcome)
β βββ popups.rs # Popup widgets (help, confirm, progress)
β βββ input.rs # Keyboard input handling
βββ Cargo.toml # Dependencies
βββ .github/
βββ workflows/ # CI/CD workflows
- Welcome Screen: If no path provided, displays logo and path input
- Scanning: Recursively walks the directory tree using parallel processing
- Smart Detection: When a
node_modulesfolder is found, it's added to the list and scanning stops at that level (avoids nestednode_modules) - Size Calculation: Calculates total size of each
node_modulesfolder - Interactive Selection: TUI allows you to navigate and select folders
- Confirmation: Warning dialog with Yes/No buttons before deletion
- Progress Display: Shows deletion progress with a visual progress bar
- Cleanup: Removes selected folders and updates the list
This project includes CI/CD workflows:
- Runs on every push and pull request
- Tests on multiple platforms (Linux, macOS, Windows)
- Runs clippy linting and tests
- Triggered on version tags (
v*) - Builds binaries for all platforms
- Creates GitHub release with artifacts
- Publishes to crates.io (stable releases only)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
