An open API service indexing awesome lists of open source software.

https://github.com/aaurelions/clearrr

🧹 Effortlessly clear heavy temp folders β€” safely, fast, and with full control.
https://github.com/aaurelions/clearrr

cache-cleaner cache-control cleaner cleaning-data clear cleardata delete node nodejs php python rust

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# clearrr

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

---

## ✨ What is clearrr?

`clearrr` is a simple but powerful CLI tool to **find and remove large build and cache folders**
like `node_modules`, `.venv`, `__pycache__`, `dist`, `build`, `.next` β€”
freeing gigabytes of disk space across all your projects.

It’s safe by default:

- **Dry-run by default:** Nothing is deleted unless you confirm.
- **Presets for Node.js, Python, or all.**
- Runs anywhere with `npx`.

---

## ⚑️ Quick start

```bash
npx clearrr [dir] [--preset=node|python|php|rust|all] [--confirm]
```

---

## βœ… Features

- πŸ—‚οΈ **Recursively finds** temp folders under any path
- πŸ”’ **Dry-run by default** β€” see what will be deleted & how much space you’ll free
- - βš™οΈ **Presets** for Node, Python, PHP, and Rust projects, or all
- ⚑️ **Fast** β€” powered by `fast-glob`
- 🧩 **Custom patterns** β€” override with your own
- 🧹 **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:

```bash
npm install -g clearrr
```

---

## 🏁 Usage

**Dry-run example (default)**
Check what would be deleted for Node projects:

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

---

**Actually delete (must confirm)**
Delete safely with `--confirm`:

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

---

**Python project example:**

```bash
npx clearrr ./my-data-scripts --preset=python --confirm
```

---

**Custom patterns:**

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

---

## πŸ“ Presets

| Preset | Folders deleted |
| ----------------- | --------------------------------------------------------------------------------------- |
| `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` |

---

## 🧯 Safety

- βœ… **Dry-run by default** β€” nothing is deleted unless `--confirm` is set.
- βœ… Does not touch `.git`, `.vscode`, `.idea`, or any source folders.
- βœ… Reports total disk space to free up before deletion.

---

## πŸ› οΈ Options

| Option | Description | Default |
| ------------------ | ----------------------------------------- | ------------- |
| `[dir]` | Root folder to scan | `.` (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

```bash
🧹 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
```