dev-clean-2.0.0 is not a library.
dev-clean 🗑️
A fast, interactive TUI tool to find and remove node_modules folders, written in Rust.

Features
- 🔍 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
Installation
From crates.io (Recommended)
From GitHub Releases
Pre-built binaries for Linux, macOS, and Windows are available on the Releases page.
Build from Source
Usage
Interactive Mode (Default)
# Launch with welcome screen (enter path interactively)
# Scan specific directory directly
# Use ~ for home directory
Workflow
1. Launch the App
Run dev-clean without arguments to see the welcome screen with ASCII logo, or provide a path directly.
██████╗ ███████╗██╗ ██╗ ██████╗██╗ ███████╗ █████╗ ███╗ ██╗
██╔══██╗██╔════╝██║ ██║ ██╔════╝██║ ██╔════╝██╔══██╗████╗ ██║
██║ ██║█████╗ ██║ ██║█████╗██║ ██║ █████╗ ███████║██╔██╗ ██║
██║ ██║██╔══╝ ╚██╗ ██╔╝╚════╝██║ ██║ ██╔══╝ ██╔══██║██║╚██╗██║
██████╔╝███████╗ ╚████╔╝ ╚██████╗███████╗███████╗██║ ██║██║ ╚████║
╚═════╝ ╚══════╝ ╚═══╝ ╚═════╝╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝
2. Enter Path or Scan
- If launched without arguments: Type the path to scan and press
Enter - Supports tilde expansion (
~/Projects→/Users/you/Projects)
3. Browse Results
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] │
└────────────────────────────────────────────────────────────────┘
4. Select Folders
- Press
Spaceto toggle selection on current item - Press
ato select all - Press
nto deselect all
5. Delete Selected
- Press
dto delete selected folders - Confirm with
Yor cancel withNin the warning dialog - Watch the progress bar as folders are deleted
Keyboard Shortcuts
| 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 |
Non-interactive Mode
# List all node_modules (no TUI)
# Delete all without confirmation (⚠️ dangerous!)
Development
Prerequisites
- Rust 1.70+
Local Development
# Run in development
# Run without path (shows welcome screen)
# Run tests
# Run with hot reload (requires cargo-watch)
Building Release Binaries
# Build for current platform
# Build static binary (Linux)
Project Structure
dev-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
How It Works
- 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
GitHub Actions Workflows
This project includes CI/CD workflows:
Build Workflow (.github/workflows/build.yml)
- Runs on every push and pull request
- Tests on multiple platforms (Linux, macOS, Windows)
- Runs clippy linting and tests
Release Workflow (.github/workflows/release.yml)
- Triggered on version tags (
v*) - Builds binaries for all platforms
- Creates GitHub release with artifacts
- Publishes to crates.io (stable releases only)
Contributing
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
License
This project is licensed under the MIT License - see the LICENSE file for details.