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.
Files changed (47) hide show
  1. purge_reaper-2.0.0/LICENSE +21 -0
  2. purge_reaper-2.0.0/PKG-INFO +507 -0
  3. purge_reaper-2.0.0/README.md +471 -0
  4. purge_reaper-2.0.0/pyproject.toml +68 -0
  5. purge_reaper-2.0.0/setup.cfg +4 -0
  6. purge_reaper-2.0.0/src/purge/__init__.py +4 -0
  7. purge_reaper-2.0.0/src/purge/cli.py +620 -0
  8. purge_reaper-2.0.0/src/purge/core/cleaner.py +193 -0
  9. purge_reaper-2.0.0/src/purge/core/config.py +135 -0
  10. purge_reaper-2.0.0/src/purge/core/disk.py +126 -0
  11. purge_reaper-2.0.0/src/purge/core/exporter.py +145 -0
  12. purge_reaper-2.0.0/src/purge/core/git_helper.py +106 -0
  13. purge_reaper-2.0.0/src/purge/core/history.py +82 -0
  14. purge_reaper-2.0.0/src/purge/core/models.py +197 -0
  15. purge_reaper-2.0.0/src/purge/core/rules.py +273 -0
  16. purge_reaper-2.0.0/src/purge/core/scanner.py +331 -0
  17. purge_reaper-2.0.0/src/purge/core/scoring.py +158 -0
  18. purge_reaper-2.0.0/src/purge/core/vault.py +252 -0
  19. purge_reaper-2.0.0/src/purge/core/zombies.py +204 -0
  20. purge_reaper-2.0.0/src/purge/ui/console.py +451 -0
  21. purge_reaper-2.0.0/src/purge_reaper.egg-info/PKG-INFO +507 -0
  22. purge_reaper-2.0.0/src/purge_reaper.egg-info/SOURCES.txt +45 -0
  23. purge_reaper-2.0.0/src/purge_reaper.egg-info/dependency_links.txt +1 -0
  24. purge_reaper-2.0.0/src/purge_reaper.egg-info/entry_points.txt +2 -0
  25. purge_reaper-2.0.0/src/purge_reaper.egg-info/requires.txt +8 -0
  26. purge_reaper-2.0.0/src/purge_reaper.egg-info/top_level.txt +1 -0
  27. purge_reaper-2.0.0/tests/test_cleaner.py +48 -0
  28. purge_reaper-2.0.0/tests/test_cleaner_symlink.py +49 -0
  29. purge_reaper-2.0.0/tests/test_cli.py +67 -0
  30. purge_reaper-2.0.0/tests/test_cli_coverage.py +107 -0
  31. purge_reaper-2.0.0/tests/test_cli_v1.py +109 -0
  32. purge_reaper-2.0.0/tests/test_cli_v2.py +178 -0
  33. purge_reaper-2.0.0/tests/test_config.py +80 -0
  34. purge_reaper-2.0.0/tests/test_disk.py +33 -0
  35. purge_reaper-2.0.0/tests/test_exporter.py +68 -0
  36. purge_reaper-2.0.0/tests/test_git_helper.py +37 -0
  37. purge_reaper-2.0.0/tests/test_global_caches.py +35 -0
  38. purge_reaper-2.0.0/tests/test_history.py +52 -0
  39. purge_reaper-2.0.0/tests/test_models.py +81 -0
  40. purge_reaper-2.0.0/tests/test_rules.py +52 -0
  41. purge_reaper-2.0.0/tests/test_rules_advanced.py +48 -0
  42. purge_reaper-2.0.0/tests/test_scanner.py +106 -0
  43. purge_reaper-2.0.0/tests/test_scoring.py +60 -0
  44. purge_reaper-2.0.0/tests/test_v2_coverage.py +203 -0
  45. purge_reaper-2.0.0/tests/test_vault.py +80 -0
  46. purge_reaper-2.0.0/tests/test_zombies.py +41 -0
  47. 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
+ [![PyPI version](https://img.shields.io/pypi/v/purge-reaper.svg?color=00d4ff&style=flat-square)](https://pypi.org/project/purge-reaper/)
53
+ [![GitHub Release](https://img.shields.io/github/v/release/shenald-dev/purge?color=00d4ff&style=flat-square&logo=github)](https://github.com/shenald-dev/purge/releases)
54
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg?style=flat-square)](https://www.python.org/downloads/)
55
+ [![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg?style=flat-square)](LICENSE)
56
+ [![CI Passing](https://img.shields.io/badge/CI-Passing-brightgreen.svg?style=flat-square)](https://github.com/shenald-dev/purge/actions)
57
+ [![Speed](https://img.shields.io/badge/speed-%3C20ms-cyan.svg?style=flat-square)](#architecture)
58
+ [![Zero Bloat](https://img.shields.io/badge/bloat-zero-success.svg?style=flat-square)](#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).