dev-prune 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -116
- package/bin/dev-prune.js +10 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="assets/readme-banner.png" alt="dev-prune —
|
|
3
|
+
<img src="assets/github-readme-banner.png" alt="dev-prune — gigabytes back, nothing you can't rebuild" width="820" />
|
|
4
4
|
|
|
5
5
|
# `dev-prune`
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Gigabytes back. Nothing you can't rebuild.
|
|
8
8
|
|
|
9
9
|
**Reclaim the disk space your idle repositories are sitting on — without ever deleting
|
|
10
10
|
something a lockfile cannot put back.**
|
|
11
11
|
|
|
12
12
|
[](https://crates.io/crates/dev-prune) [](https://pypi.org/project/dev-prune/) [](LICENSE.md) [](https://www.rust-lang.org/) [](docs/RELEASES_AND_MANUAL_INSTALL.md)
|
|
13
13
|
|
|
14
|
-
[](https://github.com/Life-Experimentalist/dev-prune/actions/workflows/ci.yml) [](https://devprune.vkrishna04.me/)
|
|
15
|
-
|
|
16
|
-
<!-- The npm badge goes back in the row above the moment `dev-prune` is published to
|
|
17
|
-
npm; until then shields.io renders it as a red "not found", which is worse than
|
|
18
|
-
having no badge at all:
|
|
19
|
-
[](https://www.npmjs.com/package/dev-prune) -->
|
|
14
|
+
[](https://github.com/Life-Experimentalist/dev-prune/actions/workflows/ci.yml) [](https://devprune.vkrishna04.me/) [](https://www.npmjs.com/package/dev-prune)
|
|
20
15
|
|
|
21
16
|
[**Website**](https://devprune.vkrishna04.me/) · [**Documentation**](docs/README.md) · [**CLI reference**](docs/CLI_REFERENCE.md) · [**Safety invariants**](docs/SAFETY_INVARIANTS.md) · [**Changelog**](CHANGELOG.md)
|
|
22
17
|
|
|
@@ -88,6 +83,10 @@ All three download the prebuilt binary for your platform, verify its published S
|
|
|
88
83
|
put it on `PATH`, and run `dev-prune setup`. Pass `--no-auto-setup` / `-NoAutoSetup` to
|
|
89
84
|
skip that last step.
|
|
90
85
|
|
|
86
|
+
Re-run any of them whenever you like. An install that is already current, complete and on
|
|
87
|
+
`PATH` is left exactly as it is and exits `0` without downloading; an older one is updated
|
|
88
|
+
in place; a newer one is not downgraded. `--force` / `-Force` writes it again regardless.
|
|
89
|
+
|
|
91
90
|
The Command Prompt form installs identically to the PowerShell one, but `cmd` cannot
|
|
92
91
|
inherit the `PATH` the installer sets in its own process, so `devp` resolves in the *next*
|
|
93
92
|
Command Prompt you open rather than the current one. PowerShell does not have that
|
|
@@ -96,6 +95,7 @@ problem.
|
|
|
96
95
|
### From a package manager
|
|
97
96
|
|
|
98
97
|
```bash
|
|
98
|
+
npm install -g dev-prune # or: npx dev-prune status
|
|
99
99
|
uv tool install dev-prune # or: uvx dev-prune status
|
|
100
100
|
pipx install dev-prune
|
|
101
101
|
pip install dev-prune
|
|
@@ -103,9 +103,15 @@ cargo binstall dev-prune # fetches the prebuilt release archive
|
|
|
103
103
|
cargo install dev-prune # builds from source, needs Rust 1.88+
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
The PyPI packages **contain the binary** — there is no download step at install
|
|
107
|
-
so they work behind a registry mirror and offline.
|
|
108
|
-
a prebuilt executable.
|
|
106
|
+
The npm and PyPI packages **contain the binary** — there is no download step at install
|
|
107
|
+
time, so they work under `npm ci --ignore-scripts`, behind a registry mirror and offline.
|
|
108
|
+
Everything but `cargo install` ships a prebuilt executable.
|
|
109
|
+
|
|
110
|
+
npm delivers it the way esbuild and Biome do: one small `dev-prune` package that lists
|
|
111
|
+
seven platform packages as optional dependencies, of which npm installs exactly the one
|
|
112
|
+
matching your machine. That is why there is no download step to block. Windows works from
|
|
113
|
+
1.8.0 onwards — earlier versions installed and then reported no binary to run, so a
|
|
114
|
+
machine still holding `dev-prune@1.7.0` needs `npm install -g dev-prune@latest`.
|
|
109
115
|
|
|
110
116
|
crates.io stores source and nothing else, so `cargo install` has no binary to fetch and
|
|
111
117
|
always compiles. [`cargo binstall`](https://github.com/cargo-bins/cargo-binstall) is the
|
|
@@ -137,7 +143,7 @@ brew install https://raw.githubusercontent.com/Life-Experimentalist/dev-prune/ma
|
|
|
137
143
|
scoop install https://raw.githubusercontent.com/Life-Experimentalist/dev-prune/main/packaging/scoop/dev-prune.json
|
|
138
144
|
```
|
|
139
145
|
|
|
140
|
-
WinGet is [submitted and in review](https://github.com/microsoft/winget-pkgs/pull/
|
|
146
|
+
WinGet is [submitted and in review](https://github.com/microsoft/winget-pkgs/pull/422809);
|
|
141
147
|
`winget install VKrishna04.dev-prune` starts resolving when that pull request merges.
|
|
142
148
|
|
|
143
149
|
The two Python entry points differ in where they land. `pip install` follows whichever
|
|
@@ -326,23 +332,27 @@ $ devp caches
|
|
|
326
332
|
|
|
327
333
|
Package manager caches
|
|
328
334
|
|
|
329
|
-
|
|
330
|
-
|
|
335
|
+
npm cache 9.98 GiB ~/.npm
|
|
336
|
+
clear: npm cache clean --force
|
|
337
|
+
npm is used by 18 of 46 registered repositories · 567.75 MiB each
|
|
331
338
|
|
|
332
|
-
|
|
333
|
-
|
|
339
|
+
uv cache 6.22 GiB ~/.cache/uv
|
|
340
|
+
clear: uv cache prune
|
|
341
|
+
uv is used by 7 of 46 registered repositories · 909.77 MiB each
|
|
334
342
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
343
|
+
pnpm store 2.07 GiB /mnt/data/.pnpm-store
|
|
344
|
+
clear: pnpm store prune --store-dir /mnt/data/.pnpm-store
|
|
345
|
+
one store per filesystem, because a hardlink into node_modules cannot cross one
|
|
346
|
+
pnpm is used by 1 of 46 registered repositories · 2.09 GiB each
|
|
338
347
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
348
|
+
nuget global packages 1.44 GiB ~/.nuget/packages
|
|
349
|
+
clear: dotnet nuget locals global-packages --clear
|
|
350
|
+
every .NET project on the machine restores from here; re-downloaded on the next restore
|
|
342
351
|
|
|
343
|
-
…
|
|
352
|
+
… (pip, bun, both go caches, gradle wrapper distributions, both cargo
|
|
353
|
+
registry caches, and the pnpm store beside your home directory)
|
|
344
354
|
|
|
345
|
-
Total
|
|
355
|
+
Total 21.99 GiB across 12 caches
|
|
346
356
|
|
|
347
357
|
→ Nothing above was deleted, and dev-prune never deletes any of it.
|
|
348
358
|
```
|
|
@@ -351,6 +361,14 @@ A cache lives outside every repository and is shared by all of them, so no singl
|
|
|
351
361
|
lockfile can prove it recoverable — and it is what makes `devp restore` fast. `devp
|
|
352
362
|
caches` reports and prints the clear command; running it is your decision.
|
|
353
363
|
|
|
364
|
+
pnpm gets a row per filesystem rather than a single row. It hardlinks its store into
|
|
365
|
+
every `node_modules` it fills, and a hardlink cannot cross a filesystem, so projects
|
|
366
|
+
kept off the system disk have a store of their own at the root of *that* filesystem —
|
|
367
|
+
`V:\.pnpm-store` on a second Windows drive, `/mnt/data/.pnpm-store` on Linux,
|
|
368
|
+
`/Volumes/Work/.pnpm-store` on macOS. `pnpm store path` only ever answers for the
|
|
369
|
+
filesystem it is run on, so dev-prune looks at the root of every filesystem that holds
|
|
370
|
+
a registered repository, and each such row names its store in the command it prints.
|
|
371
|
+
|
|
354
372
|
</details>
|
|
355
373
|
|
|
356
374
|
<details>
|
|
@@ -420,48 +438,48 @@ process that leaves a dirty working tree is a surprise.
|
|
|
420
438
|
|
|
421
439
|
## Features
|
|
422
440
|
|
|
423
|
-
| What you get
|
|
424
|
-
| :-------------------------------------------- |
|
|
425
|
-
| 🔒 **Lockfile-gated deletion** | Nothing goes without a passing read-only verification against `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lock`, `uv.lock`, `requirements.txt`, `Cargo.lock` or `go.sum`
|
|
426
|
-
| 🧩 **Any number of ecosystems per repository** | uv, npm and cargo in one root, or spread across `frontend/`, `services/api/` and `tools/cli/` — each discovered, verified and pruned on its own terms
|
|
427
|
-
| ↩️ **One-command restore** | `devp restore .` reinstalls a tree; `devp restore --last-run` puts back exactly what the most recent pass deleted, across every repository it touched
|
|
428
|
-
| 🕒 **Activity-aware** | Combines `git log` timestamps with source-file `mtime`, so uncommitted work protects a repository just as a commit does
|
|
429
|
-
| 📊 **Cache report** | `devp caches` sizes every package manager cache and store on the machine — npm to cargo to Maven, Gradle, NuGet, vcpkg, Conan, Composer, CocoaPods and Hex — and prints the command that clears each. The report is read-only; `devp caches clear <manager>` runs that command for you, after asking. Nothing on a schedule ever touches a cache
|
|
430
|
-
| 🩺 **`devp doctor`** | One read-only pass that ends by naming the *single* reason a repository would or would not be pruned. Runs no package manager, repairs nothing, safe to run twice. `devp doctor --fix` then mends what it found — installed-but-broken only
|
|
431
|
-
| 🤖 **Self-installing automation** | OS-native scheduler (Task Scheduler, LaunchAgent, systemd user timer) and non-blocking Git hooks, installed at install time and restored after an upgrade. `auto_setup`, `auto_hooks`, `auto_daemon` or `DEV_PRUNE_NO_AUTO_SETUP=1` turn it off
|
|
432
|
-
| ⚡ **0ms opt-out** | An `ignore.devprune.json` in a repository root is honoured by file presence alone — no read, no parse
|
|
433
|
-
| 🔌 **`--json` on every reporting command** | `run`, `status`, `stats`, `trust` and `caches` each emit one versioned document on stdout, diagnostics on stderr. Built for scripts and agents
|
|
434
|
-
| 🧠 **AI agent skill** | A token-lean `SKILL.md` embedded in the binary; `devp skill` exports it and prints onboarding prompts for Claude Code, Gemini Antigravity, Cursor, Windsurf, Copilot and OpenClaw
|
|
435
|
-
| 🧰 **Editor extension** | Validates `.devprune.json` as you type and shows the workspace's reclaimable size in the status bar. `devp setup` offers to install it — once, only at a terminal — into VS Code, VSCodium, Cursor, Windsurf, Positron or Kiro, each from its own registry with the release `.vsix` as fallback. [docs/IDE_INTEGRATION.md](docs/IDE_INTEGRATION.md)
|
|
436
|
-
| 🖼️ **File manager icons** | `devp icon` registers `*.devprune.json` with the OS file manager — a real `shared-mime-info` type plus hicolor icons on Linux, a folder icon on Windows. It never edits your editor settings, `PATH` or shell startup files
|
|
437
|
-
| 🌏 **Unicode-safe paths** | A repository at `ワークスペース/项目目录名称测试/프론트엔드` scans, verifies, prunes and restores exactly like an ASCII one, on all three platforms. Terminal tables are padded by display *column*, not by character, so full-width CJK names keep `devp status` and `devp doctor` aligned. Accented Latin, Cyrillic, Arabic and emoji directory names too
|
|
438
|
-
| 🚫 **No telemetry** | One optional unauthenticated `GET` to GitHub's public releases endpoint, at most weekly, no body and no identifier. Nothing else leaves the machine
|
|
441
|
+
| What you get | What it means in practice |
|
|
442
|
+
| :-------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
443
|
+
| 🔒 **Lockfile-gated deletion** | Nothing goes without a passing read-only verification against `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lock`, `uv.lock`, `requirements.txt`, `Cargo.lock` or `go.sum` |
|
|
444
|
+
| 🧩 **Any number of ecosystems per repository** | uv, npm and cargo in one root, or spread across `frontend/`, `services/api/` and `tools/cli/` — each discovered, verified and pruned on its own terms |
|
|
445
|
+
| ↩️ **One-command restore** | `devp restore .` reinstalls a tree; `devp restore --last-run` puts back exactly what the most recent pass deleted, across every repository it touched |
|
|
446
|
+
| 🕒 **Activity-aware** | Combines `git log` timestamps with source-file `mtime`, so uncommitted work protects a repository just as a commit does |
|
|
447
|
+
| 📊 **Cache report** | `devp caches` sizes every package manager cache and store on the machine — npm to cargo to conda, Maven, Gradle, NuGet, vcpkg, Conan, Composer, CocoaPods and Hex — and prints the command that clears each. The report is read-only; `devp caches clear <manager>` runs that command for you, after asking. `devp config set cache_max_gb uv=10,npm=10` says how big is too big, per manager, and marks the ones past it — `devp caches clear --over-cap all` then empties exactly those, still only when you type it. Each manager also says how many of your registered repositories use it and what that works out to per repository, and `devp caches clear --unused all` empties the ones nothing uses at all. pnpm is reported once per filesystem, because a store it hardlinks into `node_modules` cannot cross one and projects kept off the system disk get a store of their own. Nothing on a schedule ever touches a cache, and Maven's `~/.m2/repository` is never cleared at all — it holds artifacts `mvn install:install-file` put there that no remote can hand back |
|
|
448
|
+
| 🩺 **`devp doctor`** | One read-only pass that ends by naming the *single* reason a repository would or would not be pruned. Runs no package manager, repairs nothing, safe to run twice. `devp doctor --fix` then mends what it found — installed-but-broken only |
|
|
449
|
+
| 🤖 **Self-installing automation** | OS-native scheduler (Task Scheduler, LaunchAgent, systemd user timer) and non-blocking Git hooks, installed at install time and restored after an upgrade. `auto_setup`, `auto_hooks`, `auto_daemon` or `DEV_PRUNE_NO_AUTO_SETUP=1` turn it off |
|
|
450
|
+
| ⚡ **0ms opt-out** | An `ignore.devprune.json` in a repository root is honoured by file presence alone — no read, no parse |
|
|
451
|
+
| 🔌 **`--json` on every reporting command** | `run`, `status`, `stats`, `trust` and `caches` each emit one versioned document on stdout, diagnostics on stderr. Built for scripts and agents |
|
|
452
|
+
| 🧠 **AI agent skill** | A token-lean `SKILL.md` embedded in the binary; `devp skill` exports it and prints onboarding prompts for Claude Code, Gemini Antigravity, Cursor, Windsurf, Copilot and OpenClaw |
|
|
453
|
+
| 🧰 **Editor extension** | Validates `.devprune.json` as you type and shows the workspace's reclaimable size in the status bar. `devp setup` offers to install it — once, only at a terminal — into VS Code, VSCodium, Cursor, Windsurf, Positron or Kiro, each from its own registry with the release `.vsix` as fallback. [docs/IDE_INTEGRATION.md](docs/IDE_INTEGRATION.md) |
|
|
454
|
+
| 🖼️ **File manager icons** | `devp icon` registers `*.devprune.json` with the OS file manager — a real `shared-mime-info` type plus hicolor icons on Linux, a folder icon on Windows. It never edits your editor settings, `PATH` or shell startup files |
|
|
455
|
+
| 🌏 **Unicode-safe paths** | A repository at `ワークスペース/项目目录名称测试/프론트엔드` scans, verifies, prunes and restores exactly like an ASCII one, on all three platforms. Terminal tables are padded by display *column*, not by character, so full-width CJK names keep `devp status` and `devp doctor` aligned. Accented Latin, Cyrillic, Arabic and emoji directory names too |
|
|
456
|
+
| 🚫 **No telemetry** | One optional unauthenticated `GET` to GitHub's public releases endpoint, at most weekly, no body and no identifier. Nothing else leaves the machine |
|
|
439
457
|
|
|
440
458
|
---
|
|
441
459
|
|
|
442
460
|
## Commands
|
|
443
461
|
|
|
444
|
-
| Command | Also | What it does
|
|
445
|
-
| :--------------------- | :------------------------------------------------------------------ |
|
|
446
|
-
| `devp init [PATHS]` | `scan`, `onboard` | Crawls directory trees for Git repositories and registers them, then runs the `setup` integration pass
|
|
447
|
-
| `devp link [PATH]` |
|
|
448
|
-
| `devp unlink [PATH]` | `--missing` | Unregisters one; `--missing` drops every entry whose directory is gone, in one pass
|
|
449
|
-
| `devp undo` |
|
|
450
|
-
| `devp run [PATH]` | `--dry-run`, `--only`, `--skip`, `--except`, `--min-size`, `--json` | Prunes every registered repository, or one target
|
|
451
|
-
| `devp status` | `--top N`, `--drift`, `--json` | Interactive dashboard; a plain table when there is no TTY. `--top N` shows only the N biggest repositories; `--drift` lists every environment holding packages its lockfile never recorded
|
|
452
|
-
| `devp stats` | `--json` | What has already been reclaimed: lifetime total, prune passes, the last pass, and the biggest contributors
|
|
453
|
-
| `devp completions` | `bash`, `zsh`, `fish`, `powershell`, `elvish` | Prints a shell completion script to stdout, generated from the same argument definitions the binary parses with
|
|
454
|
-
| `devp caches` | `clear <manager\|all>`, `--json`
|
|
455
|
-
| `devp trust` | `--json` | What dev-prune may do on this machine: the guarantees the code enforces, then the scheduler, hooks and settings read live. Read-only
|
|
456
|
-
| `devp restore [PATH]` | `--last-run` | Reinstalls dependencies for every project in a tree; `--last-run` undoes the last prune pass
|
|
457
|
-
| `devp doctor [PATH]` | `--fix` | Diagnoses the installation, or one repository — ending with the single reason a pass would or would not touch it. `--fix` repairs what the checks found; it never performs a first-time install
|
|
458
|
-
| `devp config [ACTION]` | `get`, `set`, `show`, `wizard`, `project`, `daemon`, `hook`, `icon` | Global settings, per-repository `.devprune.json`, scheduler, Git hooks, file manager icons
|
|
459
|
-
| `devp setup` | `--status` | Installs any missing integration; `--status` only reports
|
|
460
|
-
| `devp update` | `--offline`, `--install` | Prints the installed version, checks GitHub for a newer release, shows the upgrade command for your install channel; `--install` runs that upgrade through the channel that owns this copy
|
|
461
|
-
| `devp skill` | `--agent <editor>` | Exports `SKILL.md` and prints AI agent onboarding prompts; `--agent` writes per-repository rules for
|
|
462
|
-
| `devp man` | `--dir <dir>` | The manual as man pages, generated from the same argument definitions `--help` prints; alone it emits `devp(1)` to stdout, `--dir` writes the full set
|
|
463
|
-
| `devp uninstall` | `--deep` | Removes the scheduler, hooks, both binaries and every other installed copy it can find on the machine; `--deep` also clears configuration
|
|
464
|
-
| `devp -V` |
|
|
462
|
+
| Command | Also | What it does |
|
|
463
|
+
| :--------------------- | :------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
464
|
+
| `devp init [PATHS]` | `scan`, `onboard` | Crawls directory trees for Git repositories and registers them, then runs the `setup` integration pass |
|
|
465
|
+
| `devp link [PATH]` | :------------------------------------------------------------------ | Registers one repository |
|
|
466
|
+
| `devp unlink [PATH]` | `--missing` | Unregisters one; `--missing` drops every entry whose directory is gone, in one pass |
|
|
467
|
+
| `devp undo` | :------------------------------------------------------------------ | Reverts the most recent `init` or `link` |
|
|
468
|
+
| `devp run [PATH]` | `--dry-run`, `--only`, `--skip`, `--except`, `--min-size`, `--json` | Prunes every registered repository, or one target |
|
|
469
|
+
| `devp status` | `--top N`, `--drift`, `--json` | Interactive dashboard; a plain table when there is no TTY. `--top N` shows only the N biggest repositories; `--drift` lists every environment holding packages its lockfile never recorded |
|
|
470
|
+
| `devp stats` | `--json` | What has already been reclaimed: lifetime total, prune passes, the last pass, and the biggest contributors |
|
|
471
|
+
| `devp completions` | `bash`, `zsh`, `fish`, `powershell`, `elvish` | Prints a shell completion script to stdout, generated from the same argument definitions the binary parses with |
|
|
472
|
+
| `devp caches` | `clear <manager\|all>`, `--json` | Sizes every package manager cache on the machine and prints the command that clears each. The report deletes nothing and nothing on a schedule ever will; `clear` empties one when you type it, after asking |
|
|
473
|
+
| `devp trust` | `--json` | What dev-prune may do on this machine: the guarantees the code enforces, then the scheduler, hooks and settings read live. Read-only |
|
|
474
|
+
| `devp restore [PATH]` | `--last-run` | Reinstalls dependencies for every project in a tree; `--last-run` undoes the last prune pass |
|
|
475
|
+
| `devp doctor [PATH]` | `--fix` | Diagnoses the installation, or one repository — ending with the single reason a pass would or would not touch it. `--fix` repairs what the checks found; it never performs a first-time install |
|
|
476
|
+
| `devp config [ACTION]` | `get`, `set`, `show`, `wizard`, `project`, `daemon`, `hook`, `icon` | Global settings, per-repository `.devprune.json`, scheduler, Git hooks, file manager icons |
|
|
477
|
+
| `devp setup` | `--status` | Installs any missing integration; `--status` only reports |
|
|
478
|
+
| `devp update` | `--offline`, `--install` | Prints the installed version, checks GitHub for a newer release, shows the upgrade command for your install channel; `--install` runs that upgrade through the channel that owns this copy |
|
|
479
|
+
| `devp skill` | `--agent <editor>` | Exports `SKILL.md` and prints AI agent onboarding prompts; `--agent` writes per-repository rules for 16 editors — Cursor, Windsurf, Antigravity, Cline, Roo, Kilo Code, Continue, Amazon Q, Kiro, Trae, Junie, Gemini CLI, Zed, Copilot, Aider or `AGENTS.md` |
|
|
480
|
+
| `devp man` | `--dir <dir>` | The manual as man pages, generated from the same argument definitions `--help` prints; alone it emits `devp(1)` to stdout, `--dir` writes the full set |
|
|
481
|
+
| `devp uninstall` | `--deep` | Removes the scheduler, hooks, both binaries and every other installed copy it can find on the machine; `--deep` also clears configuration |
|
|
482
|
+
| `devp -V` | :------------------------------------------------------------------ | Version plus an environment audit: OS, architecture, config path, PATH activation |
|
|
465
483
|
|
|
466
484
|
`devp hook`, `devp daemon` and `devp icon` are shorthands for the `config` subcommands of
|
|
467
485
|
the same name, and `install` / `uninstall` / `on` / `off` work wherever `enable` /
|
|
@@ -481,38 +499,42 @@ list, every setting and the `--json` schema: **[docs/CLI_REFERENCE.md](docs/CLI_
|
|
|
481
499
|
|
|
482
500
|
Adapters detect the project, verify the lockfile, and own the bloat directories:
|
|
483
501
|
|
|
484
|
-
| Ecosystem
|
|
485
|
-
|
|
|
486
|
-
| **npm**
|
|
487
|
-
| **pnpm**
|
|
488
|
-
| **Yarn**
|
|
489
|
-
| **Bun**
|
|
490
|
-
| **uv** (Python)
|
|
491
|
-
| **Poetry** (Python)
|
|
492
|
-
| **PDM** (Python)
|
|
493
|
-
| **Pipenv** (Python)
|
|
494
|
-
| **venv** (Python)
|
|
495
|
-
| **Cargo** (Rust) *(opt-in)*
|
|
496
|
-
| **Go**
|
|
497
|
-
| **Composer** (PHP)
|
|
498
|
-
| **Bundler** (Ruby)
|
|
499
|
-
| **CocoaPods** (Apple)
|
|
500
|
-
| **Mix** (Elixir)
|
|
501
|
-
| **Terraform**
|
|
502
|
-
| **Gradle** *(opt-in)*
|
|
503
|
-
| **Maven** *(opt-in)*
|
|
504
|
-
| **SwiftPM** *(opt-in)*
|
|
505
|
-
| **Dart / Flutter** *(opt-in)* | `pubspec.yaml`
|
|
502
|
+
| Ecosystem | Detected by | Bloat | Verification (read-only) | Restore |
|
|
503
|
+
| :---------------------------- | :------------------------------------------------------------ | :----------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------- |
|
|
504
|
+
| **npm** | `package-lock.json` | `node_modules` | `npm ci --dry-run --ignore-scripts` | `npm ci` |
|
|
505
|
+
| **pnpm** | `pnpm-lock.yaml` | `node_modules` | `pnpm install --lockfile-only --frozen-lockfile` | `pnpm install --frozen-lockfile` |
|
|
506
|
+
| **Yarn** | `yarn.lock` | `node_modules` | `yarn install --immutable --mode update-lockfile` (Berry); on Classic an existing `yarn.lock` is itself the proof | `yarn install --immutable` |
|
|
507
|
+
| **Bun** | `bun.lockb`, `bun.lock` | `node_modules` | `bun install --frozen-lockfile --dry-run --ignore-scripts` | `bun install --frozen-lockfile` |
|
|
508
|
+
| **uv** (Python) | `uv.lock`, `[tool.uv]` in `pyproject.toml` | `.venv` | `uv lock --locked` | `uv sync` |
|
|
509
|
+
| **Poetry** (Python) | `poetry.lock`, `[tool.poetry]` in `pyproject.toml` | `.venv` | `poetry check --lock`, plus no installed package the lockfile never recorded | `poetry install` |
|
|
510
|
+
| **PDM** (Python) | `pdm.lock`, `[tool.pdm]` or `pdm.backend` in `pyproject.toml` | `.venv`, `__pypackages__` | `pdm lock --check` | `pdm install` |
|
|
511
|
+
| **Pipenv** (Python) | `Pipfile` | `.venv` *(in-project installs only)* | `pipenv verify` | `pipenv install --deploy` |
|
|
512
|
+
| **venv** (Python) | `requirements.txt` + a directory containing `pyvenv.cfg` | every directory containing `pyvenv.cfg` | `requirements.txt` must exist and list at least one package | `python -m venv .venv && pip install -r requirements.txt` |
|
|
513
|
+
| **Cargo** (Rust) *(opt-in)* | `Cargo.toml` | `target` | `cargo metadata --locked` | *(rebuilt by the next `cargo build`)* |
|
|
514
|
+
| **Go** | `go.mod` | `vendor` | `go mod download` | `go mod vendor` |
|
|
515
|
+
| **Composer** (PHP) | `composer.json` | `vendor` | `composer validate --no-check-publish --no-check-all` | `composer install` |
|
|
516
|
+
| **Bundler** (Ruby) | `Gemfile` | `vendor/bundle` *(vendored installs only)* | `bundle lock --check` | `bundle install` |
|
|
517
|
+
| **CocoaPods** (Apple) | `Podfile` | `Pods` | `Podfile.lock` carries its `SPEC CHECKSUMS` section and is no older than the `Podfile` | `pod install` |
|
|
518
|
+
| **Mix** (Elixir) | `mix.exs` | `deps` | `mix.lock` is a complete Elixir map and no older than `mix.exs` | `mix deps.get` |
|
|
519
|
+
| **Terraform** | any `*.tf` / `*.tf.json` | `.terraform/providers` | `.terraform.lock.hcl` records at least one provider | `terraform init -backend=false` |
|
|
520
|
+
| **Gradle** *(opt-in)* | `build.gradle[.kts]`, `settings.gradle[.kts]` | `build`, `.gradle` | manifest present and readable — the rebuild-from-source proof | *(rebuilt by the next `./gradlew build`)* |
|
|
521
|
+
| **Maven** *(opt-in)* | `pom.xml` | `target` | `pom.xml` parses as a Maven manifest | *(rebuilt by the next `mvn package`)* |
|
|
522
|
+
| **SwiftPM** *(opt-in)* | `Package.swift` | `.build` | `Package.swift` declares a `Package(` — the rebuild-from-source proof | *(rebuilt by the next `swift build`)* |
|
|
523
|
+
| **Dart / Flutter** *(opt-in)* | `pubspec.yaml` | `.dart_tool` | `pubspec.lock` has a `packages:` section and is no older than `pubspec.yaml` | `dart pub get` / `flutter pub get` |
|
|
524
|
+
| **Mix `_build/`** *(opt-in)* | `mix.exs` | `_build` | `mix.exs` and `mix.lock` both present — the rebuild-from-source proof | *(rebuilt by the next `mix compile`)* |
|
|
525
|
+
| **vcpkg** (C/C++) *(opt-in)* | `vcpkg.json` | `vcpkg_installed` | `vcpkg.json` declares a non-empty `dependencies` list | *(rebuilt by the next `vcpkg install`)* |
|
|
526
|
+
| **CMake** (C/C++) *(opt-in)* | `CMakeLists.txt` | any tree holding a `CMakeCache.txt` | the tree's own `CMakeCache.txt` names a source directory inside this repository | *(rebuilt by the next `cmake --build`)* |
|
|
506
527
|
|
|
507
528
|
A required binary that is missing is a reason to skip, never a reason to delete: if `npm`
|
|
508
529
|
is not on `PATH`, the `node_modules` it owns is left exactly where it is.
|
|
509
530
|
|
|
510
|
-
The
|
|
531
|
+
The eight build-tool adapters ship **disabled**, because a build tree is regenerated
|
|
511
532
|
by recompiling, not downloading — it costs more to get back. `devp config set
|
|
512
533
|
enable_cargo true` / `enable_gradle true` / `enable_maven true` / `enable_swift true` /
|
|
513
|
-
`enable_dart true`
|
|
514
|
-
|
|
515
|
-
|
|
534
|
+
`enable_dart true` / `enable_mix_build true` / `enable_vcpkg true` /
|
|
535
|
+
`enable_cmake_build true` switches them on, and their candidates wait for
|
|
536
|
+
`build_idle_days` (45 by default), applied as the *maximum* of it and `idle_days` — the
|
|
537
|
+
build-tool gate only ever makes pruning later, never earlier.
|
|
516
538
|
|
|
517
539
|
Any one adapter can be made to wait longer than the rest: `devp config set
|
|
518
540
|
adapter_idle_days cargo=90,npm=30` sets a per-adapter floor, applied as
|
|
@@ -520,6 +542,30 @@ adapter_idle_days cargo=90,npm=30` sets a per-adapter floor, applied as
|
|
|
520
542
|
it beside the adapter checklist, grouped by language, where one heading sets the same
|
|
521
543
|
window for every adapter under it.
|
|
522
544
|
|
|
545
|
+
A download cache is a bet that re-downloading costs less than the disk it occupies,
|
|
546
|
+
and somewhere the bet stops paying. `devp config set cache_max_gb uv=10,npm=10` is
|
|
547
|
+
where you say where: a ceiling in gibibytes, per manager, measured against that
|
|
548
|
+
manager's whole footprint. A manager over its cap is **marked** in `devp caches` —
|
|
549
|
+
setting one deletes nothing — and `devp caches clear --over-cap all` empties exactly
|
|
550
|
+
what is marked, when you type it. It is keyed by the names `devp caches clear` takes
|
|
551
|
+
(`npm`, `pnpm`, `uv`, `pip`, `cargo`, `go`, `nuget`, …) rather than by adapter name,
|
|
552
|
+
because the two lists overlap without either containing the other. Empty by default:
|
|
553
|
+
no cache is too big until you say what too big is. The wizard sets caps as a third
|
|
554
|
+
column on the same checklist.
|
|
555
|
+
|
|
556
|
+
The report answers one more question the disk cannot: *who still needs this*. Beside each
|
|
557
|
+
manager it says how many of your registered repositories use it, and what its cache works
|
|
558
|
+
out to per repository — two repositories sharing a 12 GiB cache is 6 GiB each and worth a
|
|
559
|
+
look, forty sharing the same 12 GiB is 300 MiB each and is the cache doing its job. A
|
|
560
|
+
manager **no** registered repository uses is the one case where a count is enough to act
|
|
561
|
+
on: everything in it was downloaded for projects that are not on this disk any more, so
|
|
562
|
+
`devp caches clear --unused all` costs no re-download for anything you still have. The
|
|
563
|
+
count ignores whether an adapter is switched on, because the question is which managers
|
|
564
|
+
your projects *use*, not which ones a prune pass would touch, and it is shown only for the
|
|
565
|
+
managers that are also adapter names — `pip`, `conda`, `nuget`, `conan` and `hex` get
|
|
566
|
+
no number rather than a guess. With nothing registered, nothing is counted and
|
|
567
|
+
`--unused` refuses to run.
|
|
568
|
+
|
|
523
569
|
Bundler and Pipenv claim only the install that lives *inside* the repository: the
|
|
524
570
|
`vendor/bundle` a project gets from `bundle config set path vendor/bundle`, and the
|
|
525
571
|
`.venv` that appears when `PIPENV_VENV_IN_PROJECT` is set. Both tools default to a
|
|
@@ -591,22 +637,23 @@ Global settings live in `%APPDATA%\dev-prune` (Windows),
|
|
|
591
637
|
once on a first install — so the defaults are something you agreed to rather than
|
|
592
638
|
inherited — and again after an upgrade adds a setting you have never been shown.
|
|
593
639
|
|
|
594
|
-
| Key
|
|
595
|
-
|
|
|
596
|
-
| `idle_days`
|
|
597
|
-
| `min_size_mb`
|
|
598
|
-
| `scan_depth`
|
|
599
|
-
| `require_confirmation`
|
|
600
|
-
| `allow_manifest_rewrite`
|
|
601
|
-
| `command_timeout_secs`
|
|
602
|
-
| `auto_setup` · `auto_daemon` · `auto_hooks`
|
|
603
|
-
| `auto_hooks_chain`
|
|
604
|
-
| `check_interval_days`
|
|
605
|
-
| `update_check`
|
|
606
|
-
| `update_check_interval_days` · `update_check_timeout_secs`
|
|
607
|
-
| `enable_cargo`
|
|
608
|
-
| `adapter_idle_days`
|
|
609
|
-
| `disabled_adapters`
|
|
640
|
+
| Key | Default | Meaning |
|
|
641
|
+
| :--------------------------------------------------------------------------------- | :-------: | :---------------------------------------------------------------------------------- |
|
|
642
|
+
| `idle_days` | `15` | How long a repository must be untouched to become a candidate |
|
|
643
|
+
| `min_size_mb` | `0` | Smallest bloat directory worth deleting; `0` disables the floor |
|
|
644
|
+
| `scan_depth` | `6` | Levels below a repository root that discovery descends |
|
|
645
|
+
| `require_confirmation` | `true` | Whether a pass asks before deleting |
|
|
646
|
+
| `allow_manifest_rewrite` | `false` | Whether verification may *repair* a drifted lockfile instead of refusing |
|
|
647
|
+
| `command_timeout_secs` | `600` | Ceiling on any one package manager command |
|
|
648
|
+
| `auto_setup` · `auto_daemon` · `auto_hooks` | `true` | Whether the integration pass may run unattended, and what it may install |
|
|
649
|
+
| `auto_hooks_chain` | `false` | Whether it may take a `core.hooksPath` another tool holds, forwarding every hook on |
|
|
650
|
+
| `check_interval_days` | `2` | How often the OS scheduler runs a pass |
|
|
651
|
+
| `update_check` | `true` | Whether the periodic release check runs |
|
|
652
|
+
| `update_check_interval_days` · `update_check_timeout_secs` | `7` · `5` | Minimum gap between checks, and how long one may hang |
|
|
653
|
+
| `enable_cargo` … `enable_cmake_build` | `false` | Turn on an opt-in build-tool adapter; `build_idle_days` (`45`) gates all eight |
|
|
654
|
+
| `adapter_idle_days` | *(none)* | Per-adapter idle floors, as `cargo=90,npm=30` — each raises only its own window |
|
|
655
|
+
| `disabled_adapters` | *(none)* | Adapters to leave alone entirely, by name — as if that ecosystem were not installed |
|
|
656
|
+
| `cache_max_gb` | *(none)* | Per-manager cache caps in GiB, as `uv=10,npm=10` — the cap itself deletes nothing |
|
|
610
657
|
|
|
611
658
|
Three of them — `idle_days` (as `override_idle_days`), `min_size_mb` and `scan_depth` —
|
|
612
659
|
also take a per-repository form in that project's `.devprune.json`, where they win for
|
|
@@ -715,20 +762,20 @@ Deeper: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) ·
|
|
|
715
762
|
|
|
716
763
|
## Documentation
|
|
717
764
|
|
|
718
|
-
| |
|
|
719
|
-
| :------------------------------------------------------------------------------------------------------- |
|
|
720
|
-
| [Documentation hub](docs/README.md) | Index of everything below
|
|
721
|
-
| [CLI reference](docs/CLI_REFERENCE.md) | Every command, flag, setting, exit code and `--json` document
|
|
722
|
-
| [Safety invariants](docs/SAFETY_INVARIANTS.md) | The seven guarantees, and why each exists
|
|
723
|
-
| [Architecture](docs/ARCHITECTURE.md) · [HLD](docs/architecture/HLD.md) · [LLD](docs/architecture/LLD.md) | How it is built
|
|
724
|
-
| [Background automation](docs/BACKGROUND_AUTOMATION.md) | Schedulers, hooks, chaining, and turning it all off
|
|
765
|
+
| | |
|
|
766
|
+
| :------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
|
|
767
|
+
| [Documentation hub](docs/README.md) | Index of everything below |
|
|
768
|
+
| [CLI reference](docs/CLI_REFERENCE.md) | Every command, flag, setting, exit code and `--json` document |
|
|
769
|
+
| [Safety invariants](docs/SAFETY_INVARIANTS.md) | The seven guarantees, and why each exists |
|
|
770
|
+
| [Architecture](docs/ARCHITECTURE.md) · [HLD](docs/architecture/HLD.md) · [LLD](docs/architecture/LLD.md) | How it is built |
|
|
771
|
+
| [Background automation](docs/BACKGROUND_AUTOMATION.md) | Schedulers, hooks, chaining, and turning it all off |
|
|
725
772
|
| [IDE & editor integration](docs/IDE_INTEGRATION.md) | The extension, schema IntelliSense, and every editor it works in |
|
|
726
|
-
| [Adding an adapter](docs/ADDING_ADAPTERS.md) | End-to-end tutorial for a new ecosystem
|
|
727
|
-
| [Releases & manual install](docs/RELEASES_AND_MANUAL_INSTALL.md) · [Distribution](docs/DISTRIBUTION.md) | Every install channel, and building from source
|
|
728
|
-
| [Troubleshooting](docs/troubleshooting/README.md) | Symptom-first, with the fix for each
|
|
729
|
-
| [Privacy](docs/PRIVACY.md) | The one network request, in full
|
|
730
|
-
| [Market analysis](docs/MARKET_ANALYSIS.md) | Where this sits among the alternatives
|
|
731
|
-
| [Contributing](CONTRIBUTING.md) · [Security policy](SECURITY.md) · [Changelog](CHANGELOG.md) |
|
|
773
|
+
| [Adding an adapter](docs/ADDING_ADAPTERS.md) | End-to-end tutorial for a new ecosystem |
|
|
774
|
+
| [Releases & manual install](docs/RELEASES_AND_MANUAL_INSTALL.md) · [Distribution](docs/DISTRIBUTION.md) | Every install channel, and building from source |
|
|
775
|
+
| [Troubleshooting](docs/troubleshooting/README.md) | Symptom-first, with the fix for each |
|
|
776
|
+
| [Privacy](docs/PRIVACY.md) | The one network request, in full |
|
|
777
|
+
| [Market analysis](docs/MARKET_ANALYSIS.md) | Where this sits among the alternatives |
|
|
778
|
+
| [Contributing](CONTRIBUTING.md) · [Security policy](SECURITY.md) · [Changelog](CHANGELOG.md) | |
|
|
732
779
|
|
|
733
780
|
---
|
|
734
781
|
|
package/bin/dev-prune.js
CHANGED
|
@@ -22,7 +22,16 @@ const os = require('os');
|
|
|
22
22
|
|
|
23
23
|
const isWin = process.platform === 'win32';
|
|
24
24
|
const exeName = isWin ? 'dev-prune.exe' : 'dev-prune';
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
// npm refused every `dev-prune-win32-*` name with `E403 - Package name triggered spam
|
|
27
|
+
// detection`, while the identically-shaped linux and darwin names went through, so the
|
|
28
|
+
// refusal tracks the name rather than the payload. The Windows packages are named after
|
|
29
|
+
// the release assets instead. Each one still declares npm's own `win32`/`ia32` values in
|
|
30
|
+
// `os` and `cpu`, so resolution is unchanged - only the name it resolves to differs.
|
|
31
|
+
const WINDOWS_ARCH = { x64: 'x64', arm64: 'arm64', ia32: 'x86' };
|
|
32
|
+
const platformPackage = isWin
|
|
33
|
+
? `dev-prune-windows-${WINDOWS_ARCH[process.arch] || process.arch}`
|
|
34
|
+
: `dev-prune-${process.platform}-${process.arch}`;
|
|
26
35
|
|
|
27
36
|
// Must mirror Registry::config_dir() in src/config.rs.
|
|
28
37
|
function configBinDir() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev-prune",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Universal, lockfile-safe workspace pruner. Reclaims disk space from idle Git repositories by deleting only dependency and build directories a lockfile can rebuild.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dev-prune": "./bin/dev-prune.js",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"LICENSE.md"
|
|
13
13
|
],
|
|
14
14
|
"optionalDependencies": {
|
|
15
|
-
"dev-prune-darwin-arm64": "1.
|
|
16
|
-
"dev-prune-darwin-x64": "1.
|
|
17
|
-
"dev-prune-linux-arm64": "1.
|
|
18
|
-
"dev-prune-linux-x64": "1.
|
|
19
|
-
"dev-prune-
|
|
20
|
-
"dev-prune-
|
|
21
|
-
"dev-prune-
|
|
15
|
+
"dev-prune-darwin-arm64": "1.8.0",
|
|
16
|
+
"dev-prune-darwin-x64": "1.8.0",
|
|
17
|
+
"dev-prune-linux-arm64": "1.8.0",
|
|
18
|
+
"dev-prune-linux-x64": "1.8.0",
|
|
19
|
+
"dev-prune-windows-arm64": "1.8.0",
|
|
20
|
+
"dev-prune-windows-x64": "1.8.0",
|
|
21
|
+
"dev-prune-windows-x86": "1.8.0"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=20"
|