Metadata-Version: 2.4
Name: diskreap
Version: 0.1.0
Summary: Reclaim disk space from build artifacts & dependency caches (node_modules, .venv, target, .next, __pycache__ …) across every language in one scan. Zero dependencies, no install.
Author: yyfjj
License: MIT
Project-URL: Homepage, https://github.com/jjdoor/diskreap-py
Project-URL: Repository, https://github.com/jjdoor/diskreap-py
Project-URL: Issues, https://github.com/jjdoor/diskreap-py/issues
Keywords: disk,cleanup,node_modules,build-artifacts,cache,reclaim,disk-space,cli,monorepo,devtools
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# diskreap

**Reclaim disk space from build artifacts and dependency caches — across every
language, in one scan.** `node_modules`, `.venv`, `target`, `.next`,
`__pycache__`, `.gradle`, `dist/build`, and more — `diskreap` finds them all,
shows you what's eating your disk, and deletes only what a single command can
rebuild. Zero dependencies, **pure standard library**.

```bash
# Run without installing:
pipx run diskreap                 # scan the current directory

# Or install it:
pip install diskreap
diskreap clean ~/code             # reclaim (asks first)
```

## Why

Every project you've ever touched left a `node_modules` or a `target/` behind.
Across a `~/code` folder with dozens of repos, that's easily tens of gigabytes
of stuff you never think about — until the disk fills up.

The existing tools each cover one corner: `npkill` is node_modules-only,
`kondo` needs a Rust toolchain. `diskreap` is **one zero-dependency command**
that reaches **every ecosystem at once** and refuses to touch anything that
isn't safely regenerable. (A byte-for-byte twin also ships on npm as
[`diskreap`](https://github.com/jjdoor/diskreap) for `npx` users.)

## What it reclaims

| Directory | Kind | Comes back via |
|-----------|------|----------------|
| `node_modules` | Node deps | `npm install` |
| `.venv` · `venv` | Python venv | `python -m venv` |
| `__pycache__` · `.pytest_cache` · `.mypy_cache` · `.ruff_cache` | Python caches | auto |
| `.next` · `.nuxt` · `.svelte-kit` · `.turbo` · `.parcel-cache` | JS build/cache | rebuild |
| `target` *(beside `Cargo.toml`/`pom.xml`)* | Rust/Maven build | `cargo`/`mvn build` |
| `.gradle` | Gradle cache | `gradle build` |
| `vendor` *(beside `composer.json`/`go.mod`)* | PHP/Go deps | `composer`/`go install` |
| `dist` · `build` *(beside a project manifest)* | Build output | rebuild |
| `.terraform` · `Pods` | Terraform / CocoaPods | `init` / `pod install` |

**Safety by design:** generic names like `target`, `dist`, `build`, `vendor`
are only ever matched when a sibling project file proves their origin — a bare
`build/` folder of your own files is never touched. Symlinks are never followed,
and `clean` always asks before deleting (unless you pass `--yes`).

## Usage

```bash
diskreap [path]                 # scan (default: current dir)
diskreap scan ~/code            # explicit scan
diskreap clean ~/code           # delete (confirms first)
```

### Scan

```bash
diskreap scan ~/code
#
#  /Users/you/code
#
#     412 MB  Node deps        webapp/node_modules        · 3w ago
#     1.2 GB  Rust/Maven build scanner/target            · 5d ago
#      88 MB  Python venv      ml-notes/.venv            · 2mo ago
#     ────────────────────────────────────────────────────
#     total reclaimable: 1.7 GB across 12 dir(s)
```

### Filters

```bash
diskreap scan ~/code --min 100MB        # ignore the small fry
diskreap scan ~/code --older 30d        # only stuff untouched for a month
diskreap scan ~/code --only node_modules,target
diskreap scan ~/code --json             # machine-readable
```

### Clean

```bash
diskreap clean ~/code --dry-run         # preview exactly what would go
diskreap clean ~/code --older 60d       # reap only long-idle projects
diskreap clean ~/code --yes             # no prompt (scripts / CI)
```

`clean` accepts the same `--min` / `--older` / `--only` filters as `scan`.

## Exit codes

| Code | Meaning |
|------|---------|
| `0` | ok (scan complete, or clean finished) |
| `2` | error (bad args, or a deletion failed) |

## Size & duration formats

Sizes: `500K` · `10MB` · `1.5G` (binary units). Durations: `12h` · `30d` ·
`2w` (a bare number means days).

## License

MIT
