/clearrr

🧹 Effortlessly clear heavy temp folders β€” safely, fast, and with full control.

Primary LanguageJavaScript

clearrr

🧹 Effortlessly clear project junk and system caches β€” safely, fast, and with full control.


✨ What is clearrr?

clearrr is a simple but powerful CLI tool to find and remove large, temporary folders.

It has two main functions:

  1. Clean Projects: Remove build artifacts and dependency folders like node_modules, .venv, dist, build, and target to free up gigabytes across all your projects.
  2. Clean System Caches: The cache command safely removes gigabytes of disposable cache files from your user home directory, targeting tools like Xcode, npm, pip, Homebrew, browsers, and more.

It’s safe by design:

  • Dry-run by default: Nothing is deleted unless you confirm.
  • Powerful presets for projects and system caches.
  • Runs anywhere instantly with npx.

⚑️ Quick Start

1. To clean a project directory:

# See what would be deleted in the current folder
npx clearrr

# Actually delete the files
npx clearrr --confirm

2. To clean your system's user caches:

# See how much space you can reclaim from global caches
npx clearrr cache

# Perform the cleanup
npx clearrr cache --confirm

βœ… Features

  • 🏠 System Cache Cleaning β€” A dedicated cache command to clear gigabytes from your user home directory.
  • πŸ—‚οΈ Recursive Project Scanning β€” Finds temp folders deep within any path.
  • πŸ”’ Dry-run by Default β€” See what will be deleted & how much space you’ll free.
  • βš™οΈ Smart Presets β€” Targets for Node, Python, PHP, and Rust projects.
  • ⚑️ Fast β€” Powered by fast-glob.
  • 🧩 Custom Patterns β€” Override presets with your own list.
  • 🧹 Safe β€” Never touches .git, source files, or config folders.

πŸ“¦ Install (optional)

You can run with npx β€” no install needed.

Or install globally for daily use:

npm install -g clearrr

🏁 Usage

1. Cleaning Project Folders

This is the default command. It scans a directory for build artifacts and dependencies.

Dry-run example (default) Check what would be deleted for Node projects in a specific monorepo:

npx clearrr ./my-monorepo --preset=node

Actually delete (must confirm) Delete safely by adding the --confirm flag:

npx clearrr ./my-monorepo --preset=node --confirm

Custom patterns:

npx clearrr . --patterns="node_modules,dist,build,.cache" --confirm

2. Cleaning Global System Caches

The cache command scans your user home directory (~/) for common application and development tool caches that are safe to delete.

Dry-run the cache cleaner:

npx clearrr cache

Confirm to free up gigabytes of space:

npx clearrr cache --confirm

πŸ“ Presets

Preset Folders Targeted
node node_modules, .next, .nuxt, .turbo, .parcel-cache, .cache, dist, build
python venv, .venv, __pycache__, .mypy_cache, .pytest_cache, build, dist, .tox
php vendor
rust target
all (default) Everything in node + python + php + rust.
cache ~/.cache, ~/Library/Caches, Xcode DerivedData, npm, pip, Homebrew, Yarn, browser caches, and many more.

🧯 Safety

  • βœ… Dry-run by default β€” nothing is deleted unless --confirm is set.
  • βœ… Targets only well-known disposable directories.
  • βœ… Does not touch .git, .vscode, .idea, or any source folders.
  • βœ… Reports total disk space to be freed up before asking for confirmation.

πŸ› οΈ Options

Option Description Default
[dir] Root folder to scan (project mode only) . (current)
--preset node, python, php, rust, or all all
--patterns Override preset with custom comma-list β€”
--dry-run Explicit dry-run true
--confirm Actually delete matched folders false
--[no-]recursive Enable/disable recursive search true

πŸ“Š Example output

🧹 clearrr preset: node
πŸ“‚ Searching in: /Users/you/Developer
🧩 Patterns: node_modules,.next,.nuxt,.turbo,.parcel-cache,.cache,dist,build

[dry-run] Would delete: /Users/you/Developer/project1/node_modules (242.3 MB)
[dry-run] Would delete: /Users/you/Developer/project2/.next (58.1 MB)

βœ… Would free approximately 300.4 MB.

πŸ’‘ To confirm deletion, re-run with --confirm