purge-reaper 2.0.0__tar.gz
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.
- purge_reaper-2.0.0/LICENSE +21 -0
- purge_reaper-2.0.0/PKG-INFO +507 -0
- purge_reaper-2.0.0/README.md +471 -0
- purge_reaper-2.0.0/pyproject.toml +68 -0
- purge_reaper-2.0.0/setup.cfg +4 -0
- purge_reaper-2.0.0/src/purge/__init__.py +4 -0
- purge_reaper-2.0.0/src/purge/cli.py +620 -0
- purge_reaper-2.0.0/src/purge/core/cleaner.py +193 -0
- purge_reaper-2.0.0/src/purge/core/config.py +135 -0
- purge_reaper-2.0.0/src/purge/core/disk.py +126 -0
- purge_reaper-2.0.0/src/purge/core/exporter.py +145 -0
- purge_reaper-2.0.0/src/purge/core/git_helper.py +106 -0
- purge_reaper-2.0.0/src/purge/core/history.py +82 -0
- purge_reaper-2.0.0/src/purge/core/models.py +197 -0
- purge_reaper-2.0.0/src/purge/core/rules.py +273 -0
- purge_reaper-2.0.0/src/purge/core/scanner.py +331 -0
- purge_reaper-2.0.0/src/purge/core/scoring.py +158 -0
- purge_reaper-2.0.0/src/purge/core/vault.py +252 -0
- purge_reaper-2.0.0/src/purge/core/zombies.py +204 -0
- purge_reaper-2.0.0/src/purge/ui/console.py +451 -0
- purge_reaper-2.0.0/src/purge_reaper.egg-info/PKG-INFO +507 -0
- purge_reaper-2.0.0/src/purge_reaper.egg-info/SOURCES.txt +45 -0
- purge_reaper-2.0.0/src/purge_reaper.egg-info/dependency_links.txt +1 -0
- purge_reaper-2.0.0/src/purge_reaper.egg-info/entry_points.txt +2 -0
- purge_reaper-2.0.0/src/purge_reaper.egg-info/requires.txt +8 -0
- purge_reaper-2.0.0/src/purge_reaper.egg-info/top_level.txt +1 -0
- purge_reaper-2.0.0/tests/test_cleaner.py +48 -0
- purge_reaper-2.0.0/tests/test_cleaner_symlink.py +49 -0
- purge_reaper-2.0.0/tests/test_cli.py +67 -0
- purge_reaper-2.0.0/tests/test_cli_coverage.py +107 -0
- purge_reaper-2.0.0/tests/test_cli_v1.py +109 -0
- purge_reaper-2.0.0/tests/test_cli_v2.py +178 -0
- purge_reaper-2.0.0/tests/test_config.py +80 -0
- purge_reaper-2.0.0/tests/test_disk.py +33 -0
- purge_reaper-2.0.0/tests/test_exporter.py +68 -0
- purge_reaper-2.0.0/tests/test_git_helper.py +37 -0
- purge_reaper-2.0.0/tests/test_global_caches.py +35 -0
- purge_reaper-2.0.0/tests/test_history.py +52 -0
- purge_reaper-2.0.0/tests/test_models.py +81 -0
- purge_reaper-2.0.0/tests/test_rules.py +52 -0
- purge_reaper-2.0.0/tests/test_rules_advanced.py +48 -0
- purge_reaper-2.0.0/tests/test_scanner.py +106 -0
- purge_reaper-2.0.0/tests/test_scoring.py +60 -0
- purge_reaper-2.0.0/tests/test_v2_coverage.py +203 -0
- purge_reaper-2.0.0/tests/test_vault.py +80 -0
- purge_reaper-2.0.0/tests/test_zombies.py +41 -0
- purge_reaper-2.0.0/tests/test_zombies_advanced.py +43 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shenald-dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: purge-reaper
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: π§Ή Zero-latency developer bloat and zombie process reaper. Reclaim 50GB in 3 seconds.
|
|
5
|
+
Author-email: Shenal Diluksha <shenald@users.noreply.github.com>
|
|
6
|
+
Maintainer-email: shenald-dev <shenald@users.noreply.github.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/shenald-dev/purge
|
|
9
|
+
Project-URL: Documentation, https://github.com/shenald-dev/purge#readme
|
|
10
|
+
Project-URL: Repository, https://github.com/shenald-dev/purge
|
|
11
|
+
Project-URL: Issues, https://github.com/shenald-dev/purge/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/shenald-dev/purge/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: purge,cleaner,node_modules,zombie-processes,disk-space,developer-tools,tui,cli
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: System :: Systems Administration
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: rich>=13.7.0
|
|
29
|
+
Requires-Dist: typer>=0.12.0
|
|
30
|
+
Requires-Dist: psutil>=5.9.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: ruff>=0.3.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
<div align="center">
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
βββββββ βββ ββββββββββ βββββββ ββββββββ
|
|
41
|
+
βββββββββββ βββββββββββββββββββ ββββββββ
|
|
42
|
+
βββββββββββ ββββββββββββββ ββββββββββ
|
|
43
|
+
βββββββ βββ ββββββββββββββ βββββββββ
|
|
44
|
+
βββ ββββββββββββ ββββββββββββββββββββ
|
|
45
|
+
βββ βββββββ βββ βββ βββββββ ββββββββ
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### π§Ή The Zero-Latency Developer Bloat & Zombie Process Reaper
|
|
49
|
+
|
|
50
|
+
*Reclaim 50GB of dev debris and slay zombie dev servers in seconds. Now featuring intelligent priority scoring, quarantine undo vault, and drive capacity radar.*
|
|
51
|
+
|
|
52
|
+
[](https://pypi.org/project/purge-reaper/)
|
|
53
|
+
[](https://github.com/shenald-dev/purge/releases)
|
|
54
|
+
[](https://www.python.org/downloads/)
|
|
55
|
+
[](LICENSE)
|
|
56
|
+
[](https://github.com/shenald-dev/purge/actions)
|
|
57
|
+
[](#architecture)
|
|
58
|
+
[](#quick-start)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
[The Problem](#-the-problem) β’
|
|
63
|
+
[What's New in v2.0](#-whats-new-in-v20) β’
|
|
64
|
+
[Key Features](#-key-features) β’
|
|
65
|
+
[Terminal UI](#-terminal-ui) β’
|
|
66
|
+
[Quick Start](#-quick-start) β’
|
|
67
|
+
[Commands](#-commands--usage) β’
|
|
68
|
+
[Quarantine Vault](#-quarantine-vault--undo) β’
|
|
69
|
+
[Purge Scoring Engine](#-purge-scoring-engine) β’
|
|
70
|
+
[Drive Radar](#-drive-capacity-radar) β’
|
|
71
|
+
[Configuration](#-configuration) β’
|
|
72
|
+
[Supported Artifacts](#-supported-bloat-targets) β’
|
|
73
|
+
[Architecture](#-architecture)
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
## π₯ The Problem
|
|
80
|
+
|
|
81
|
+
Modern developers juggle dozens of repositories and tools every month. After a few weeks, engineering laptops silently hoard **40GB to 100GB+** of developer debris:
|
|
82
|
+
|
|
83
|
+
- **Abandoned `node_modules`** from tutorials and archived experiments.
|
|
84
|
+
- **Massive Rust `target/` directories** silently consuming 15GB each.
|
|
85
|
+
- **Dormant Python `.venv` environments** and build artifacts (`dist`, `.next`, `.turbo`, `.astro`).
|
|
86
|
+
- **Bloated Global Package Caches** (`npm`, `pnpm`, `pip`, `uv`, `cargo`, `bun`, `deno`) accumulating stale tarballs indefinitely.
|
|
87
|
+
- **Zombie Dev Servers** left running in background terminal tabs, holding ports `:3000`, `:5173`, or `:8000`, draining RAM, and causing frustrating `EADDRINUSE` errors.
|
|
88
|
+
|
|
89
|
+
Existing tools are fragmented: `npkill` only cleans npm; `cargo clean` requires manually visiting each repository; `docker prune` only handles containers; and finding port hogs requires cryptic `lsof -i :3000` and `kill -9` terminal dances.
|
|
90
|
+
|
|
91
|
+
**`purge` is a unified, blazing-fast reaper.** It scans your workspaces concurrently, prunes directory traversal at artifact boundaries, audits global caches, slays process trees holding your dev ports, and lets you reclaim 50GB in seconds.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## π What's New in v2.0
|
|
96
|
+
|
|
97
|
+
- π― **Purge Priority Scoring Engine (0-100 Index):** Intelligent composite score weighting size footprint, staleness, ecosystem re-creation cost, and Git repository state. Easily target high-value bloat with `--min-score` or `--auto`.
|
|
98
|
+
- π‘οΈ **Quarantine Undo Vault (`purge clean --vault` / `purge vault restore`):** Zero accidental data loss. Move targets to a local quarantine vault instead of permanent deletion, with instant 1-second one-command restoration.
|
|
99
|
+
- πΎ **Drive Capacity Radar (`purge disk` / `purge top`):** Visual partition health analysis displaying total/used/free space, developer bloat percentage, and potential free disk gain.
|
|
100
|
+
- π **Multi-Format Audit Exporter (`purge export`):** Export comprehensive markdown reports, RFC-4180 CSV spreadsheets, or structured JSON for team audits and CI/CD pipelines.
|
|
101
|
+
- β‘ **High-Concurrency Parallel Deletion (`--workers 4`):** Multi-threaded deletion pool with robust Windows file-lock retry backoff and readonly clearing.
|
|
102
|
+
- π **Expanded Ecosystem Support:** Native heuristic detection for Bun (`~/.bun/install/cache`), Deno (`~/.cache/deno`), Swift PM (`.build`), Zig (`.zig-cache`, `zig-out`), CMake (`CMakeFiles`), PHP Composer (`vendor`), and Ruby Bundler.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## β‘ Key Features
|
|
107
|
+
|
|
108
|
+
- β‘ **Sub-Second Parallel Crawl:** Never gets bogged down by millions of files inside `node_modules`βprunes traversal at candidate boundaries and sizes directories concurrently in <20ms.
|
|
109
|
+
- π§ **Process Tree Port Slayer (`purge free <PORT>`):** Free ports in one command. Recursively terminates parent processes and all orphaned child worker trees (`SIGTERM` -> `SIGKILL` cascade).
|
|
110
|
+
- π **Global Cache Auditing & Pruning (`purge cache`):** Discovers and purges multi-gigabyte package manager global caches (`npm`, `pnpm`, `yarn`, `bun`, `deno`, `pip`, `uv`, `cargo`, `go`, `gradle`, `composer`).
|
|
111
|
+
- πΏ **Git Worktree Intelligence:** Non-destructive scan flags repositories with uncommitted changes (`--git-aware`, `--skip-uncommitted`) and displays last-commit age indicators.
|
|
112
|
+
- π **Lifetime Reclamation Telemetry (`purge stats`):** Persistent local telemetry tracking cumulative bytes reclaimed and zombie processes terminated over time.
|
|
113
|
+
- π― **Interactive Selection Mode (`-i / --interactive`):** Pick and choose specific artifacts via numbers or comma-separated lists before purging.
|
|
114
|
+
- π€ **Autonomous Reclamation (`--auto`):** Automatically selects and purges safe, high-scoring targets (Score β₯ 65) without manual picking.
|
|
115
|
+
- βοΈ **Declarative Configuration (`purge init`):** Native `purge.toml` and `pyproject.toml [tool.purge]` support for team-level ignore paths, custom target rules, and depth limits.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## π» Terminal UI
|
|
120
|
+
|
|
121
|
+
When you run `purge scan` across your workspace:
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
125
|
+
β π§Ή Developer Bloat & Zombie Process Reaper β’ Zero Bloat β
|
|
126
|
+
ββββββββββββββββ v2.0.0 β’ https://github.com/shenald-dev/purge ββββββββββββββββ
|
|
127
|
+
|
|
128
|
+
π¦ Reclaimable Bloat Targets (4)
|
|
129
|
+
βββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββββββ¬βββββββββββ¬βββββββββββββ¬ββββββββββ¬βββββββββ¬βββββββββββββββ
|
|
130
|
+
β # β Category β Path β Files β Git Status β Stale β Score β Size β
|
|
131
|
+
βββββΌβββββββββββββββββββΌβββββββββββββββββββββββββββΌβββββββββββΌβββββββββββββΌββββββββββΌβββββββββΌβββββββββββββββ€
|
|
132
|
+
β 1 β Node.js & Web β ~/Projects/web/node_modβ¦ β 48,120 β Clean β 42d ago β 92/100 β 1.42 GB β
|
|
133
|
+
β 2 β Rust / Cargo β ~/Projects/engine/target β 4,890 β Uncommittedβ 18d ago β 45/100 β 820.50 MB β
|
|
134
|
+
β 3 β Python β ~/Projects/ai/.venv β 6,410 β Clean β 89d ago β 85/100 β 410.20 MB β
|
|
135
|
+
β 4 β Node.js & Web β ~/Projects/app/.next β 1,210 β Clean β Today β 35/100 β 120.00 MB β
|
|
136
|
+
βββββ΄βββββββββββββββββββ΄βββββββββββββββββββββββββββ΄βββββββββββ΄βββββββββββββ΄ββββββββββ΄βββββββββ΄βββββββββββββββ
|
|
137
|
+
|
|
138
|
+
π§ Zombie Dev Servers & Port Hogs (2)
|
|
139
|
+
ββββββββββββ¬βββββββββββββββββ¬βββββββββββββ¬βββββββββββββ¬ββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
|
|
140
|
+
β PID β Name β Port β Memory β Trees β Command / Working Dir β
|
|
141
|
+
ββββββββββββΌβββββββββββββββββΌβββββββββββββΌβββββββββββββΌββββββββΌββββββββββββββββββββββββββββββββββββββββ€
|
|
142
|
+
β 48210 β node β :3000 β 142.0 MB β 3 β ~/Projects/web (Next.js Dev Server) β
|
|
143
|
+
β 19420 β python β :8000 β 86.4 MB β 1 β ~/Projects/ai (FastAPI Uvicorn) β
|
|
144
|
+
ββββββββββββ΄βββββββββββββββββ΄βββββββββββββ΄βββββββββββββ΄ββββββββ΄ββββββββββββββββββββββββββββββββββββββββ
|
|
145
|
+
|
|
146
|
+
ββββββββββββββββββββββββββ π PURGE REAPER TELEMETRY ββββββββββββββββββββββββββ
|
|
147
|
+
β β
|
|
148
|
+
β Reclaimable Disk Space: 2.77 GB β
|
|
149
|
+
β β’ Total Targets: 4 β’ Total Files: 60,630 β’ Zombie Servers: 2 β
|
|
150
|
+
β β’ π― High Priority Targets (Score β₯ 65): 2 β
|
|
151
|
+
β Breakdown: Node.js: 1.54 GB | Rust: 820.50 MB | Python: 410.20 MB β
|
|
152
|
+
β β
|
|
153
|
+
β Scanned 840 directories in 0.015s. β
|
|
154
|
+
β β
|
|
155
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## π Quick Start
|
|
161
|
+
|
|
162
|
+
### Installation
|
|
163
|
+
|
|
164
|
+
Install directly via `pip`:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pip install purge-reaper
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Or install via `pipx` or `uv`:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
pipx install purge-reaper
|
|
174
|
+
# or
|
|
175
|
+
uv tool install purge-reaper
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## π οΈ Commands & Usage
|
|
181
|
+
|
|
182
|
+
### 1. Scan Workspace for Bloat (`purge scan`)
|
|
183
|
+
Sweep the current project tree or an entire drive for dev artifacts and running servers:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Scan current directory
|
|
187
|
+
purge scan
|
|
188
|
+
|
|
189
|
+
# Scan your entire Projects directory
|
|
190
|
+
purge scan ~/Projects
|
|
191
|
+
|
|
192
|
+
# Filter by ecosystem
|
|
193
|
+
purge scan --node # Only Node.js/Web (.next, node_modules, .astro)
|
|
194
|
+
purge scan --python # Only Python (.venv, __pycache__, .pytest_cache)
|
|
195
|
+
purge scan --rust # Only Rust (target/)
|
|
196
|
+
|
|
197
|
+
# Filter by staleness, minimum size, or priority score
|
|
198
|
+
purge scan --stale 30 # Untouched for 30+ days
|
|
199
|
+
purge scan --min-size 100MB # Only items larger than 100MB
|
|
200
|
+
purge scan --min-score 70 # Only high-yield targets (score β₯ 70)
|
|
201
|
+
|
|
202
|
+
# Sort & limit
|
|
203
|
+
purge scan --sort score --top 10 # Top 10 highest-scoring targets
|
|
204
|
+
purge scan --sort stale # Sort by longest untouched
|
|
205
|
+
|
|
206
|
+
# Include drive capacity radar
|
|
207
|
+
purge scan --disk
|
|
208
|
+
|
|
209
|
+
# Include global package manager caches
|
|
210
|
+
purge scan --global
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 2. Clean & Reclaim Disk Space (`purge clean`)
|
|
214
|
+
Execute safe, verified cleanup:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Dry run simulation (calculates space without deleting)
|
|
218
|
+
purge clean --dry-run
|
|
219
|
+
|
|
220
|
+
# Autonomous mode: automatically clean high-scoring safe targets (Score β₯ 65)
|
|
221
|
+
purge clean --auto
|
|
222
|
+
|
|
223
|
+
# Quarantine mode: move to undo vault instead of permanent deletion
|
|
224
|
+
purge clean --vault
|
|
225
|
+
|
|
226
|
+
# Interactive selection (pick items by number e.g. 1, 3, 5)
|
|
227
|
+
purge clean -i
|
|
228
|
+
|
|
229
|
+
# Safeguard: Skip repositories with uncommitted git changes
|
|
230
|
+
purge clean --skip-uncommitted
|
|
231
|
+
|
|
232
|
+
# High-concurrency parallel deletion (4 worker threads)
|
|
233
|
+
purge clean --workers 4 --force
|
|
234
|
+
|
|
235
|
+
# Force purge + terminate zombie dev servers
|
|
236
|
+
purge clean --force --kill-zombies
|
|
237
|
+
|
|
238
|
+
# Move files to OS Trash / Recycle Bin instead of permanent deletion
|
|
239
|
+
purge clean --trash
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 3. Quarantine Vault & Undo (`purge vault`)
|
|
243
|
+
Safe staging and instant restoration:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
# List all quarantine sessions
|
|
247
|
+
purge vault list
|
|
248
|
+
|
|
249
|
+
# Show items in a specific vault session
|
|
250
|
+
purge vault show vault_20261103_120000
|
|
251
|
+
|
|
252
|
+
# Restore quarantined items back to their original disk locations
|
|
253
|
+
purge vault restore vault_20261103_120000
|
|
254
|
+
|
|
255
|
+
# Permanently prune quarantine sessions older than 14 days
|
|
256
|
+
purge vault prune --days 14
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 4. Drive Capacity Radar (`purge disk` / `purge top`)
|
|
260
|
+
Analyze drive partition health and bloat percentage:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# Inspect drive capacity and top space consumers
|
|
264
|
+
purge disk
|
|
265
|
+
|
|
266
|
+
# Output machine-readable JSON
|
|
267
|
+
purge disk --json
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### 5. Instant One-Shot Port Slayer (`purge free` / `purge port`)
|
|
271
|
+
Free any occupied development port without manually looking up PIDs:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Inspect what process is hogging port 3000
|
|
275
|
+
purge free 3000
|
|
276
|
+
|
|
277
|
+
# Terminate the process and its entire child process tree
|
|
278
|
+
purge free 3000 --kill -y
|
|
279
|
+
|
|
280
|
+
# Alias command
|
|
281
|
+
purge port 5173 -k -y
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### 6. Audit Report Exporter (`purge export`)
|
|
285
|
+
Export audit results to Markdown, CSV, or JSON:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# Export Markdown audit report
|
|
289
|
+
purge export ~/Projects --output audit_report.md
|
|
290
|
+
|
|
291
|
+
# Export CSV spreadsheet for team reviews
|
|
292
|
+
purge export ~/Projects --output audit_report.csv
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### 7. Global Package Manager Caches (`purge cache`)
|
|
296
|
+
Audit and reclaim multi-gigabyte caches from npm, pip, uv, cargo, and more:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Scan all global caches and show disk usage
|
|
300
|
+
purge cache
|
|
301
|
+
|
|
302
|
+
# Clean all discovered caches with confirmation
|
|
303
|
+
purge cache --clean
|
|
304
|
+
|
|
305
|
+
# Simulate cleaning without deleting
|
|
306
|
+
purge cache --clean --dry-run
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### 8. Lifetime Reclamation Telemetry (`purge stats`)
|
|
310
|
+
Check cumulative metrics across all cleanups:
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
purge stats
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## π― Purge Scoring Engine
|
|
319
|
+
|
|
320
|
+
The Purge Score is an intelligent 0-100 composite index calculated from four primary factors:
|
|
321
|
+
|
|
322
|
+
1. **Size Factor (0-35 pts):** Logarithmic scale rewarding larger space yields (β₯2GB = 35pts).
|
|
323
|
+
2. **Staleness Factor (0-30 pts):** Based on last-modified timestamps (β₯90 days = 30pts).
|
|
324
|
+
3. **Ephemerality / Rebuild Cost (0-20 pts):** Pure re-generable caches (`node_modules`, `.next`, `target/`) receive full marks; virtual environments require re-installation (+12pts).
|
|
325
|
+
4. **Git Repository Intelligence (0-15 pts / Safety Penalties):** Repos with uncommitted changes receive an automatic **-35 point penalty** and are flagged `CAUTION`. Clean, dormant repos receive a bonus.
|
|
326
|
+
|
|
327
|
+
| Score Range | Classification | Action Recommendation |
|
|
328
|
+
| :--- | :--- | :--- |
|
|
329
|
+
| **65 - 100** | `SAFE` / High Priority | Immediate candidate for automated reclamation. |
|
|
330
|
+
| **35 - 64** | `MODERATE` | Review if project is actively being developed. |
|
|
331
|
+
| **0 - 34** | `CAUTION` | Active repository, recently modified, or uncommitted work. |
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## π‘οΈ Quarantine Vault & Undo
|
|
336
|
+
|
|
337
|
+
Never worry about accidentally deleting an active development environment:
|
|
338
|
+
|
|
339
|
+
```text
|
|
340
|
+
Target Path ββββββββββββββΊ [ purge clean --vault ]
|
|
341
|
+
β
|
|
342
|
+
βΌ
|
|
343
|
+
~/.config/purge/vault/<session_id>/
|
|
344
|
+
βββ item_1 (node_modules)
|
|
345
|
+
βββ item_2 (.venv)
|
|
346
|
+
βββ manifest.json
|
|
347
|
+
|
|
348
|
+
β
|
|
349
|
+
βΌ
|
|
350
|
+
[ purge vault restore <session_id> ]
|
|
351
|
+
β
|
|
352
|
+
βΌ
|
|
353
|
+
Target Path βββββββββββββ Restored in 1 Second!
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## πΎ Drive Capacity Radar
|
|
359
|
+
|
|
360
|
+
```text
|
|
361
|
+
βββββββββββββββββ πΎ DISK CAPACITY & BLOAT RADAR (D:\) βββββββββββββββββ
|
|
362
|
+
β β
|
|
363
|
+
β Mount: D:\ Device: D: (NTFS) β
|
|
364
|
+
β β
|
|
365
|
+
β [ββββββββββββββββββββββββββββββ] 53.2% Used β
|
|
366
|
+
β β
|
|
367
|
+
β β’ Total Capacity: 953.87 GB β
|
|
368
|
+
β β’ Used Space: 507.45 GB β
|
|
369
|
+
β β’ Free Space: 446.42 GB (46.8%) β
|
|
370
|
+
β β
|
|
371
|
+
β β’ Developer Bloat: 48.60 GB β
|
|
372
|
+
β β’ Bloat accounts for 5.1% of total drive capacity (9.6% of used) β
|
|
373
|
+
β β’ Purging this bloat will increase free space by +10.9% β
|
|
374
|
+
β β
|
|
375
|
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## βοΈ Configuration
|
|
381
|
+
|
|
382
|
+
Configure `purge` on a per-project or workspace basis via `purge.toml` or `pyproject.toml` (`[tool.purge]`):
|
|
383
|
+
|
|
384
|
+
```toml
|
|
385
|
+
# purge.toml
|
|
386
|
+
[purge]
|
|
387
|
+
max_depth = 10
|
|
388
|
+
min_stale_days = 0.0
|
|
389
|
+
min_size_bytes = 0
|
|
390
|
+
min_score = 0.0
|
|
391
|
+
sort_by = "size"
|
|
392
|
+
workers = 4
|
|
393
|
+
git_aware = true
|
|
394
|
+
default_trash = false
|
|
395
|
+
default_vault = false
|
|
396
|
+
default_format = "terminal"
|
|
397
|
+
|
|
398
|
+
# Ignored paths or projects
|
|
399
|
+
ignore_paths = [
|
|
400
|
+
"production-app/*",
|
|
401
|
+
"legacy-service/.venv",
|
|
402
|
+
]
|
|
403
|
+
|
|
404
|
+
# Custom artifact target rules
|
|
405
|
+
[purge.custom_rules]
|
|
406
|
+
"Internal Caches" = [".custom_cache", "temp_artifacts"]
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## π¦ Supported Bloat Targets
|
|
412
|
+
|
|
413
|
+
### Local Project Bloat
|
|
414
|
+
|
|
415
|
+
| Ecosystem | Targets Detected |
|
|
416
|
+
| :--- | :--- |
|
|
417
|
+
| **Node.js & Modern Web** | `node_modules`, `.next`, `.turbo`, `.nuxt`, `.astro`, `.solid`, `.remix`, `.output`, `.nx`, `.contentlayer`, `.parcel-cache`, `.svelte-kit`, `.docusaurus`, `bower_components` |
|
|
418
|
+
| **Python** | `.venv`, `venv`, `env`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `__pycache__`, `.tox`, `.nox`, `.hypothesis`, `.ipynb_checkpoints` |
|
|
419
|
+
| **Rust / Cargo** | `target` *(safeguarded: verified against `Cargo.toml`)* |
|
|
420
|
+
| **Systems & Native** | `.build` *(Swift PM)*, `.zig-cache`, `zig-out` *(Zig)*, `CMakeFiles` *(CMake)* |
|
|
421
|
+
| **PHP & Ruby** | `vendor` *(safeguarded: verified against `composer.json` or `Gemfile`)* |
|
|
422
|
+
| **Mobile & Cross-Platform** | `.expo`, `Pods`, `.dart_tool`, `DerivedData` |
|
|
423
|
+
| **JVM & Build Systems** | `.gradle`, `pom.xml` target dirs, `.bloop`, `.metals`, `.kotlinc` |
|
|
424
|
+
| **Universal Build Dirs** | `dist`, `build`, `out`, `coverage`, `.nyc_output` |
|
|
425
|
+
| **OS Clutter** | `.DS_Store`, `Thumbs.db` |
|
|
426
|
+
| **Dev Servers** | Zombie processes on `:3000`, `:3001`, `:5173`, `:8000`, `:8080`, `:9000` |
|
|
427
|
+
|
|
428
|
+
### Global Package Manager Caches
|
|
429
|
+
|
|
430
|
+
| Package Manager | Default Cache Locations Checked |
|
|
431
|
+
| :--- | :--- |
|
|
432
|
+
| **npm** | `~/.npm/_cacache` |
|
|
433
|
+
| **pnpm** | `~/.local/share/pnpm/store`, `~/AppData/Local/pnpm/store` |
|
|
434
|
+
| **yarn** | `~/.yarn/berry/cache`, `~/.cache/yarn`, `~/AppData/Local/Yarn/Cache` |
|
|
435
|
+
| **Bun** | `~/.bun/install/cache` |
|
|
436
|
+
| **Deno** | `~/.cache/deno`, `~/AppData/Local/deno` |
|
|
437
|
+
| **pip** | `~/.cache/pip`, `~/AppData/Local/pip/Cache` |
|
|
438
|
+
| **uv** | `~/.cache/uv`, `~/AppData/Local/uv/cache` |
|
|
439
|
+
| **cargo** | `~/.cargo/registry/cache`, `~/.cargo/git/db` |
|
|
440
|
+
| **go** | `~/go/pkg/mod/cache`, `~/AppData/Local/go-build` |
|
|
441
|
+
| **gradle** | `~/.gradle/caches` |
|
|
442
|
+
| **Composer** | `~/.cache/composer`, `~/AppData/Local/Composer/cache` |
|
|
443
|
+
| **Bundler** | `~/.bundle/cache` |
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## βοΈ Architecture
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
βββββββββββββββββββββββββββ
|
|
451
|
+
β User Target Path β
|
|
452
|
+
βββββββββββββ¬ββββββββββββββ
|
|
453
|
+
β
|
|
454
|
+
βΌ
|
|
455
|
+
βββββββββββββββββββββββββββ
|
|
456
|
+
β Rapid Discovery Walk β (Sub-20ms pruning at
|
|
457
|
+
β (os.scandir tree) β artifact boundaries)
|
|
458
|
+
βββββββββββββ¬ββββββββββββββ
|
|
459
|
+
β
|
|
460
|
+
βββββββββββββββββββββββΌββββββββββββββββββββββ
|
|
461
|
+
βΌ βΌ βΌ
|
|
462
|
+
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
|
|
463
|
+
β Parallel Stat β β Git Intelligence β β Zombie Hunter β
|
|
464
|
+
β & Scoring Pool β β (Dormancy/Dirty) β β (Dev port trees) β
|
|
465
|
+
βββββββββββ¬βββββββββ βββββββββββ¬βββββββββ βββββββββββ¬βββββββββ
|
|
466
|
+
β β β
|
|
467
|
+
ββββββββββββββββββ¬βββββ΄ββββββββββββββββββββββ
|
|
468
|
+
β
|
|
469
|
+
βΌ
|
|
470
|
+
βββββββββββββββββββββββββββ
|
|
471
|
+
β Purge Scoring Engine β (0-100 Priority Index)
|
|
472
|
+
β (Size, Age, Git State) β
|
|
473
|
+
βββββββββββββ¬ββββββββββββββ
|
|
474
|
+
β
|
|
475
|
+
βΌ
|
|
476
|
+
βββββββββββββββββββββββββββ
|
|
477
|
+
β Cyberpunk Terminal HUD β
|
|
478
|
+
β & Multi-Format Exporter β
|
|
479
|
+
βββββββββββββ¬ββββββββββββββ
|
|
480
|
+
β
|
|
481
|
+
βββββββββββββββ΄ββββββββββββββ
|
|
482
|
+
βΌ βΌ
|
|
483
|
+
βββββββββββββββββββββββββ βββββββββββββββββββββββββ
|
|
484
|
+
β Parallel Fast Deletionβ β Quarantine Undo Vault β
|
|
485
|
+
β (Retry & RO Clearing) β β (Instant Restoration) β
|
|
486
|
+
βββββββββββββββββββββββββ βββββββββββββββββββββββββ
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
## π€ Contributing
|
|
492
|
+
|
|
493
|
+
Contributions are welcome! Please open an issue or PR on [GitHub](https://github.com/shenald-dev/purge).
|
|
494
|
+
|
|
495
|
+
```bash
|
|
496
|
+
git clone https://github.com/shenald-dev/purge.git
|
|
497
|
+
cd purge
|
|
498
|
+
pip install -e ".[dev]"
|
|
499
|
+
pytest
|
|
500
|
+
ruff check .
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## π License
|
|
506
|
+
|
|
507
|
+
MIT License. Designed and built with β€οΈ by [shenald-dev](https://github.com/shenald-dev).
|