resq-clean
Version:.gitignore-aware workspace cleaner for ResQ developmentv0.1.16· License:Apache-2.0· Crate: crates.io · API docs: docs.rs
Overview
.gitignore-aware workspace cleaner for ResQ development. Provides a TUI that scans for build artifacts and gitignored files, lets you select what to remove, and reclaims disk space safely.
Overview
resq-clean walks the repository tree, applies .gitignore rules via the ignore crate (supporting negated patterns and nested .gitignore files), and presents every gitignored entry in an interactive list sorted by size. You can toggle individual items on or off before confirming deletion.
Cleanup Decision Tree
Installation
CLI Arguments
| Flag | Default | Description |
|---|---|---|
--dry-run | false | Preview what would be deleted without removing anything. Pressing Enter in the TUI exits instead of deleting. |
Usage Examples
Interactive TUI (default)
Dry Run
Enter exits the TUI without performing any deletions, letting you inspect what would be removed.
Targeted Cleanup
TUI Keybindings
| Key | Action |
|---|---|
q / Esc | Quit without deleting |
Space | Toggle selection on the highlighted item |
Enter | Delete all selected items (or exit in --dry-run mode) |
Up / k | Move selection up |
Down / j | Move selection down |
What Gets Deleted
Anything matched by.gitignore rules, which typically includes:
| Pattern | Description |
|---|---|
target/ | Rust build output |
node_modules/ | npm/bun dependencies |
.next/ | Next.js build cache |
dist/ | TypeScript/Bun build output |
build/ | CMake build directories |
__pycache__/ | Python bytecode cache |
*.pyc | Compiled Python files |
.pytest_cache/ | Pytest cache |
*.o, *.a, *.so | C/C++ object files and libraries |
*.nettrace | .NET profiling traces |
flamegraph.svg | Generated flame graph profiles |
!dist/keep-this.json) are preserved automatically.
Environment Variables
No environment variables are required. The tool operates entirely on the local filesystem using the current working directory as its root.Output Format
The TUI header displays the total size of all currently selected items (e.g.,PENDING: 2.4 GB). Each entry in the list shows:
[x]/[ ]— selection checkbox- Icon — folder or file indicator
- Relative path — path relative to the scan root
- Size — human-readable size (B, KB, MB, GB)
Safety Notes
- Dry-run first: Always use
--dry-runon the first pass to review what will be removed. - Gitignore-only: Only files and directories matched by
.gitignorerules are candidates for deletion. Tracked files are never touched. - Negated patterns respected: Entries matching negated patterns (e.g.,
!important.log) are excluded from the scan. - No .git deletion: The
.gitdirectory and its contents are unconditionally skipped. - Interactive confirmation: Nothing is deleted until you press
Enterin the TUI. You can deselect individual items withSpacebefore confirming. - Re-scan after deletion: After deleting, the tool re-scans to show the updated state, so you can verify the results.
- Directories removed recursively: Selected directories are removed with
remove_dir_all. Ensure you have deselected anything you want to keep.
When to Use
- Before committing, to ensure no build artifacts slip through
- After switching branches, to avoid stale build caches
- Periodic deep clean when disk space is low