windowsweep 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ All notable changes to `windowsweep` are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres to
6
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [1.0.0] - 2026-09-03
11
+
12
+ First release. The Windows member of the cleanup family beside
13
+ [linux-cleanup](https://github.com/aoneahsan/linux-cleanup) and
14
+ [macleanup](https://github.com/aoneahsan/macleanup).
15
+
16
+ ### Added
17
+
18
+ - **22 numbered sections** (0-21): package-manager caches, build-tool caches, test-runner browsers, Android
19
+ emulators, Docker, editor caches, browser caches, desktop-app caches, Windows user caches, user temp, Recycle
20
+ Bin, Windows Update cache, the Disk Cleanup engine, DISM component-store cleanup, the hibernation file, event
21
+ logs, stale project build artefacts, partial downloads, large stale personal files, disk-image compaction and
22
+ a disk-usage report. Section numbers are a public contract from this release on.
23
+ - **Developer mode.** The first interactive run asks whether you are a developer. Yes means package, build and
24
+ test-runner caches are pruned only when idle 100+ days and the newest version of every versioned tool cache
25
+ is kept; no means those caches are cleared completely. The answer is saved and can be re-asked with
26
+ `--forget-developer`.
27
+ - **A dry-run that writes nothing** (`--dry-run`), a read-only scan (`--scan`) and `--list-targets`.
28
+ - **One deletion chokepoint** that refuses drive roots, Windows, Program Files, the profile root, personal
29
+ folders, credentials, toolchains and browser/editor state, asserts every deletion lies inside its declared
30
+ target root, never follows junctions or symlinks, handles paths longer than 260 characters and skips files
31
+ another program has open.
32
+ - **Batch policy.** `--all` runs the safe batch only; deep sections (11, 15, 16, 20) need
33
+ `--i-understand-deep`; personal sections (17, 18, 19) never run unattended and use the Recycle Bin.
34
+ - **Admin awareness.** Admin sections skip with the exact command when not elevated; `--elevate` relaunches
35
+ through a UAC prompt.
36
+ - **Session reports** as schema-versioned JSON with Markdown and HTML export, a reports manager, run history
37
+ (`--stats`), history pruning and `--json` for scripting.
38
+ - **Weekly Scheduled Task** (`--install-task`) and a PowerShell profile alias (`--install-alias`).
39
+ - **Self-test** (`--self-test`): script syntax, ASCII-only source, the protection lists, a real junction
40
+ fixture, the dry-run guarantee, keep-newest, long paths and the extension-leftover rule.
41
+ - **Crash bundles** written locally on unexpected exit; `--debug-bundle` and `--report-issue` for bug reports.
42
+ Nothing is ever transmitted.
43
+ - Node launcher for `npx windowsweep`, a `.cmd` launcher for machines without Node, and a `ci` workflow that
44
+ runs the self-test and a dry-run on both Windows PowerShell 5.1 and PowerShell 7.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ahsan Mahmood
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.
package/README.md ADDED
@@ -0,0 +1,482 @@
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/aoneahsan/windowsweep/main/assets/logo/windowsweep-mark.svg" alt="windowsweep logo" width="120" />
4
+
5
+ <h1>windowsweep</h1>
6
+
7
+ <p><strong>Safe-by-default Windows cleanup CLI - developer-aware, dry-run first, zero install via npx.</strong></p>
8
+
9
+ [![npm version](https://img.shields.io/npm/v/windowsweep.svg)](https://www.npmjs.com/package/windowsweep)
10
+ [![downloads](https://img.shields.io/npm/dm/windowsweep.svg)](https://www.npmjs.com/package/windowsweep)
11
+ [![license](https://img.shields.io/npm/l/windowsweep.svg)](https://github.com/aoneahsan/windowsweep/blob/main/LICENSE)
12
+ [![ci](https://github.com/aoneahsan/windowsweep/actions/workflows/ci.yml/badge.svg)](https://github.com/aoneahsan/windowsweep/actions/workflows/ci.yml)
13
+ [![node](https://img.shields.io/node/v/windowsweep.svg)](https://nodejs.org)
14
+ [![platform](https://img.shields.io/badge/platform-Windows%2010%20%7C%2011-0078d4?logo=windows&logoColor=white)](https://github.com/aoneahsan/windowsweep#platform-support)
15
+
16
+ [Docs](https://github.com/aoneahsan/windowsweep/blob/main/docs/README.md) · [npm](https://www.npmjs.com/package/windowsweep) · [GitHub](https://github.com/aoneahsan/windowsweep) · [Changelog](https://github.com/aoneahsan/windowsweep/blob/main/CHANGELOG.md) · [Contributing](https://github.com/aoneahsan/windowsweep/blob/main/CONTRIBUTING.md) · [Support](https://github.com/aoneahsan/windowsweep/issues)
17
+
18
+ </div>
19
+
20
+ > [!IMPORTANT]
21
+ > **This tool deletes files.** Most of what it removes are caches that rebuild themselves; personal files it
22
+ > lists go to the Recycle Bin; two sections (emptying the Recycle Bin, clearing event logs) are permanent and
23
+ > gated behind a separate flag. Start with `npx windowsweep --scan`, which deletes nothing, then
24
+ > `npx windowsweep --dry-run --all --yes`, which shows exactly what a real run would remove.
25
+ > **Windows only** - npm refuses to install it elsewhere.
26
+
27
+ `windowsweep` reclaims the disk space that quietly disappears on a Windows machine: package-manager and build
28
+ caches, browser and app caches, Windows temp and update leftovers, stale `node_modules`, half-finished downloads.
29
+ It is a PowerShell tool with a thin Node launcher, so `npx windowsweep` runs it with nothing to install. What
30
+ sets it apart is restraint: it asks whether you are a developer and keeps the caches you used in the last
31
+ 100 days, it names every path before touching it, it never follows a junction, and it makes no network calls.
32
+ It is the Windows member of a family with [linux-cleanup](https://github.com/aoneahsan/linux-cleanup) and
33
+ [macleanup](https://github.com/aoneahsan/macleanup).
34
+
35
+ | | |
36
+ |---|---|
37
+ | **Version** | `1.0.0` |
38
+ | **License** | MIT |
39
+ | **Node** | `>=14` (launcher only) |
40
+ | **Runtime** | Windows PowerShell 5.1 (built in) or PowerShell 7 |
41
+ | **Platforms** | Windows 10 (1809+) and Windows 11 |
42
+ | **Install size** | ~78 kB packed · ~263 kB unpacked · 37 files · no dependencies |
43
+ | **Undo** | Recycle Bin for personal files; none for caches (they regenerate) |
44
+ | **Status** | Stable · actively maintained |
45
+
46
+ <a id="table-of-contents"></a>
47
+ ## 🧭 Table of Contents&nbsp;[#](#table-of-contents)
48
+
49
+ - [💡 Why windowsweep](#why-windowsweep)
50
+ - [✨ Features](#features)
51
+ - [📱 Platform Support](#platform-support)
52
+ - [📋 Requirements](#requirements)
53
+ - [📦 Installation](#installation)
54
+ - [🚀 Quick Start](#quick-start)
55
+ - [🛠️ Usage](#usage)
56
+ - [⚙️ Configuration](#configuration)
57
+ - [💻 Command Line](#command-line)
58
+ - [🧪 Examples](#examples)
59
+ - [🎛️ Advanced Features](#advanced-features)
60
+ - [🚑 Recovery & Troubleshooting](#recovery-troubleshooting)
61
+ - [🚧 Limitations](#limitations)
62
+ - [❓ FAQ](#faq)
63
+ - [📚 Documentation](#documentation)
64
+ - [🔄 Changelog](#changelog)
65
+ - [🤝 Contributing](#contributing)
66
+ - [🗂️ Repository](#repository)
67
+ - [💬 Support](#support)
68
+ - [📄 License](#license)
69
+ - [👤 Author](#author)
70
+ - [🔗 Links](#links)
71
+ - [🏷️ Keywords](#keywords)
72
+
73
+ <a id="why-windowsweep"></a>
74
+ ## 💡 Why windowsweep&nbsp;[#](#why-windowsweep)
75
+
76
+ A Windows machine that is also a development machine fills up in places Disk Cleanup has never heard of: the
77
+ Yarn and npm caches, Gradle, Cypress and Playwright browsers, Android emulator images, Docker's virtual disk,
78
+ `node_modules` for a project you finished in spring, editor caches, two hundred profiles' worth of Chrome cache.
79
+ Clearing them by hand means keeping a private list of paths and remembering which ones bite back.
80
+
81
+ A cleaner that wipes every cache it finds trades one problem for another: the next `yarn install` re-downloads
82
+ twelve gigabytes and your afternoon is gone. `windowsweep` takes the narrower path.
83
+
84
+ | | `windowsweep` | Windows Disk Cleanup / Storage Sense | A wipe-everything cleaner |
85
+ |---|---|---|---|
86
+ | **Knows developer caches** | yarn, npm, pnpm, Gradle, Cypress, Playwright, AVDs, Docker, editors | no | some |
87
+ | **Default action** | prune files idle 100+ days; keep the newest version of every tool | fixed categories | wipe the whole cache |
88
+ | **Personal folders** | hard refusal, no flag bypasses it | out of scope | usually configurable |
89
+ | **Junctions and symlinks** | never followed | n/a | varies |
90
+ | **Dry-run** | every section, exact estimate | no | sometimes |
91
+ | **Unattended use** | `--all --yes`, Scheduled Task | Storage Sense | GUI-first |
92
+ | **Network calls** | none | Microsoft telemetry | varies |
93
+
94
+ Nothing here can promise a number. How much comes back depends on your disk; `--scan` measures it.
95
+
96
+ **Not the right tool when** you want a graphical, set-and-forget cleaner; when you are on Linux or macOS (use the
97
+ siblings); when you want an undo for caches (there is none - they regenerate); or when you are looking for a
98
+ security scanner or a registry cleaner. It reclaims disk space, nothing else.
99
+
100
+ <a id="features"></a>
101
+ ## ✨ Features&nbsp;[#](#features)
102
+
103
+ - **Developer mode** - one question on the first run. Yes keeps package, build and test-runner caches used in
104
+ the last 100 days and the newest version of every versioned tool; no clears them completely.
105
+ - **22 numbered sections** - from package-manager caches to Windows Update leftovers, each naming its paths
106
+ before it acts. Numbers are a public contract.
107
+ - **One deletion chokepoint** - refuses drive roots, Windows, Program Files, your profile root, personal
108
+ folders, credentials, toolchains and browser or editor state; asserts every deletion sits inside its declared
109
+ target; never follows a junction or symlink; handles paths beyond 260 characters; skips files another program
110
+ has open.
111
+ - **A dry-run that writes nothing** - `--dry-run` short-circuits every deletion and every destructive command
112
+ and reports an exact estimate. `--scan` and `--list-targets` are read-only.
113
+ - **Personal files go to the Recycle Bin** - partial downloads and large stale files are listed, you pick, and
114
+ Windows keeps the undo.
115
+ - **Batch policy** - `--all` runs the safe batch only; deep sections need `--i-understand-deep`; personal
116
+ sections never run unattended.
117
+ - **Admin awareness** - sections that need Administrator rights skip with the exact command when the console
118
+ is not elevated; `--elevate` relaunches through a UAC prompt.
119
+ - **Running-app guard** - an open browser, editor or app keeps its caches; the tool tells you which to close.
120
+ - **Session reports** - schema-versioned JSON, exportable to Markdown or a self-contained HTML page, plus
121
+ `--json` for scripts.
122
+ - **Self-test** - proves the guards on your machine with a real junction, a 400-character path and a dry-run
123
+ fixture before you trust it.
124
+ - **Offline by design** - zero network calls, no telemetry, no update check. Crash bundles stay on disk.
125
+
126
+ <a id="platform-support"></a>
127
+ ## 📱 Platform Support&nbsp;[#](#platform-support)
128
+
129
+ | Platform | Supported | Notes |
130
+ |---|---|---|
131
+ | Windows 11 | ✅ | Windows PowerShell 5.1 or PowerShell 7 |
132
+ | Windows 10 (1809 and later) | ✅ | The primary development target |
133
+ | Windows Server 2019+ | ⚠️ | Uses nothing newer than 1809, but Server is not in the test matrix |
134
+ | Linux | ❌ | `os: ["win32"]` makes npm refuse to install; use [linux-cleanup](https://github.com/aoneahsan/linux-cleanup) |
135
+ | macOS | ❌ | Use [macleanup](https://github.com/aoneahsan/macleanup) |
136
+
137
+ <a id="requirements"></a>
138
+ ## 📋 Requirements&nbsp;[#](#requirements)
139
+
140
+ | Requirement | Version | Why |
141
+ |---|---|---|
142
+ | Windows PowerShell | `5.1` | Ships with Windows 10 and 11; the engine is written for it. PowerShell 7 also works (`--pwsh`) |
143
+ | Node.js | `>=14` | Only for `npx` and `npm install -g`. The `.cmd` launcher and `windowsweep.ps1` need no Node |
144
+ | Administrator rights | optional | Only sections 12-16 and 20 (Windows Update cache, Disk Cleanup engine, DISM, hibernation, event logs, disk-image compaction) |
145
+ | `docker` | optional | Section 5 only |
146
+
147
+ `windowsweep --self-test` reports which optional tools are missing on your machine.
148
+
149
+ <a id="installation"></a>
150
+ ## 📦 Installation&nbsp;[#](#installation)
151
+
152
+ No install needed:
153
+
154
+ ```powershell
155
+ npx windowsweep --scan
156
+ ```
157
+
158
+ To keep it on your `PATH`:
159
+
160
+ ```powershell
161
+ npm install -g windowsweep
162
+ ```
163
+
164
+ Or clone the repository and run it without Node:
165
+
166
+ ```powershell
167
+ git clone https://github.com/aoneahsan/windowsweep.git
168
+ cd windowsweep
169
+ .\windowsweep.cmd --self-test
170
+ ```
171
+
172
+ Both launchers start PowerShell with `-ExecutionPolicy Bypass`, so the machine's script policy never blocks a
173
+ run. Logs and reports land in `%USERPROFILE%\.windowsweep\` on every path - outside the npm cache, so history
174
+ survives `npx` evictions. Full detail:
175
+ [Installation](https://github.com/aoneahsan/windowsweep/blob/main/docs/installation.md).
176
+
177
+ <a id="quick-start"></a>
178
+ ## 🚀 Quick Start&nbsp;[#](#quick-start)
179
+
180
+ Prove the guards, look, rehearse, then clean:
181
+
182
+ ```powershell
183
+ npx windowsweep --self-test
184
+ npx windowsweep --scan
185
+ npx windowsweep --dry-run --all --yes
186
+ npx windowsweep
187
+ ```
188
+
189
+ The last command is the guided walkthrough: it asks the developer question, shows a pre-scan, then visits each
190
+ section with `a` run / `s` skip / `q` quit and a running total.
191
+
192
+ <a id="usage"></a>
193
+ ## 🛠️ Usage&nbsp;[#](#usage)
194
+
195
+ ### The sections
196
+
197
+ **Tier** says what happens to the data: *report* deletes nothing, *rebuilds* comes back on its own, *slow*
198
+ comes back but costs minutes, *Recycle Bin* is recoverable until you empty it, *permanent* is not, *config*
199
+ changes a setting.
200
+
201
+ | # | Section | Tier | Admin | Batch |
202
+ |---|---|---|:-:|---|
203
+ | 0 | System health report | report | - | safe |
204
+ | 1 | Package-manager caches (npm, yarn, pnpm, bun, deno, pip, uv, Composer, NuGet, Cargo, Go, pub) | rebuilds | - | safe · developer-gated |
205
+ | 2 | Build-tool caches (Gradle, Maven, Android, Unity, JetBrains) | rebuilds | - | safe · developer-gated |
206
+ | 3 | Test-runner browsers (Cypress, Playwright, Puppeteer) - newest kept | rebuilds | - | safe · developer-gated |
207
+ | 4 | Android emulators idle N+ days | slow | - | opt-in |
208
+ | 5 | Docker: dangling layers, build cache, unused images older than N days | rebuilds | - | safe · developer-gated |
209
+ | 6 | Editor caches, dead workspace storage, uninstalled extension folders | rebuilds | - | safe |
210
+ | 7 | Browser caches, every profile (Chrome, Edge, Brave, Vivaldi, Opera, Firefox, ...) | rebuilds | - | safe |
211
+ | 8 | Desktop-app caches (Slack, Teams, Discord, Postman, Figma, Spotify, ...) | rebuilds | - | safe |
212
+ | 9 | Windows user caches (shader caches, error reports, crash dumps, Store-app temp) | rebuilds | - | safe |
213
+ | 10 | User temp files idle 3+ days | rebuilds | - | safe |
214
+ | 11 | Empty the Recycle Bin | **permanent** | - | deep |
215
+ | 12 | Windows Update cache, Delivery Optimization, `Windows\Temp`, servicing logs | rebuilds | yes | safe when elevated |
216
+ | 13 | Disk Cleanup engine with a curated handler list | rebuilds | yes | safe when elevated |
217
+ | 14 | Component store cleanup (DISM) | rebuilds | yes | opt-in |
218
+ | 15 | Hibernation file off or reduced | config | yes | deep |
219
+ | 16 | Clear Windows Event Logs | **permanent** | yes | deep |
220
+ | 17 | Stale project build artefacts (`node_modules`, `dist`, `.next`, `target`, ...) | rebuilds | - | interactive |
221
+ | 18 | Partial / orphan downloads | Recycle Bin | - | interactive |
222
+ | 19 | Large stale personal files in Downloads | Recycle Bin | - | interactive |
223
+ | 20 | Docker Desktop / WSL disk-image compaction | config | yes | deep |
224
+ | 21 | Disk usage report | report | - | safe |
225
+
226
+ *Safe* sections run in `--all`; *opt-in* ones run when named in `--only` or a profile; *deep* ones also need
227
+ `--i-understand-deep`; *interactive* ones never run unattended. Every section is documented in
228
+ [Sections 0-21](https://github.com/aoneahsan/windowsweep/blob/main/docs/sections.md).
229
+
230
+ ### Clean interactively
231
+
232
+ ```powershell
233
+ windowsweep # guided walkthrough, one confirmation per step
234
+ windowsweep --menu # jump to one section; toggle dry-run and auto-yes
235
+ ```
236
+
237
+ ### Clean unattended
238
+
239
+ ```powershell
240
+ windowsweep --all --yes
241
+ windowsweep --profile dev --yes
242
+ windowsweep --only 1,7,10 --yes
243
+ ```
244
+
245
+ `--yes` applies to regenerable caches only. No flag combination batch-deletes personal files.
246
+
247
+ ### System-level cleanup
248
+
249
+ ```powershell
250
+ windowsweep --profile system --yes --elevate
251
+ ```
252
+
253
+ Relaunches through a UAC prompt and runs the Windows Update, Disk Cleanup and DISM sections. Add the
254
+ hibernation file with `--only 12,13,14,15 --hiberfil off --yes --i-understand-deep --elevate`.
255
+
256
+ <a id="configuration"></a>
257
+ ## ⚙️ Configuration&nbsp;[#](#configuration)
258
+
259
+ There is no configuration you must do. Defaults live in `%USERPROFILE%\.windowsweep\config.json`
260
+ (`developer`, `days`, `tempDays`, `largeFileMb`, `scanRoots`, `excludePaths`); flags always win.
261
+
262
+ | Variable | Default | What it does |
263
+ |---|---|---|
264
+ | `WINDOWSWEEP_HOME` | `%USERPROFILE%\.windowsweep` | Data directory for logs, reports, bundles and config |
265
+ | `WINDOWSWEEP_LOG_DIR`, `WINDOWSWEEP_REPORTS_DIR` | under the data directory | Same as `--logs-dir` / `--reports-dir` |
266
+ | `WINDOWSWEEP_SHELL` | `powershell` | `pwsh` runs the engine on PowerShell 7 (launcher only) |
267
+ | `NO_COLOR`, `WINDOWSWEEP_NO_COLOR` | unset | Disable colour |
268
+ | `WINDOWSWEEP_ASCII` | unset | Plain ASCII glyphs |
269
+
270
+ Full reference: [CLI reference](https://github.com/aoneahsan/windowsweep/blob/main/docs/cli-reference.md).
271
+
272
+ <a id="command-line"></a>
273
+ ## 💻 Command Line&nbsp;[#](#command-line)
274
+
275
+ ```powershell
276
+ windowsweep [mode] [options]
277
+ ```
278
+
279
+ | Mode | Flag | What it does |
280
+ |---|---|---|
281
+ | Walkthrough | *(default)* · `-w` | 🔥 Every section, one confirmation per step |
282
+ | Menu | `-m` | 🔥 One section at a time |
283
+ | Safe batch | `-a`, `--all` | 🔥 Sections 0,1,2,3,5,6,7,8,9,10,21 (+12,13 when elevated) |
284
+ | Only / profile / exclude | `--only L`, `--profile NAME`, `--exclude L` | 🔥 Exactly these sections; profiles `dev`, `minimal`, `cache-only`, `system`, `deep`, `audit` |
285
+ | Scan | `-s`, `--scan` | Read-only: health, sizes, personal-file scanners |
286
+ | List targets | `--list`, `--list-targets` | The catalogue; every path the tool can touch |
287
+ | Self-test | `--self-test` | Syntax, ASCII-only source, guards, junction and dry-run fixtures |
288
+ | Reports | `--reports`, `--export F [ID]`, `--stats`, `--prune-history N` | Browse, export (md/html), summarise, prune |
289
+ | Setup | `--install-task`, `--install-alias` (and `--uninstall-*`) | Weekly Scheduled Task; `cleanup` profile function |
290
+ | Feedback | `--feedback`, `--report-issue`, `--debug-bundle` | Offline help; a pre-filled issue you review first |
291
+ | Version / help | `-V`, `-h` | |
292
+
293
+ | Option | Default | What it does |
294
+ |---|---|---|
295
+ | `--dry-run` | off | Delete nothing; show what would go and how much it frees |
296
+ | `-y`, `--yes` | off | Auto-confirm regenerable caches. Never personal files |
297
+ | `--i-understand-deep` | off | Allow sections 11, 15, 16, 20 unattended (with `--yes`) |
298
+ | `--elevate` | off | Relaunch elevated through a UAC prompt |
299
+ | `-d N`, `--days N` | `100` | Idle window: a file goes when its newest timestamp is N+ days old |
300
+ | `--temp-days N` | `3` | Idle window for temp folders |
301
+ | `--purge-all` | off | 🔥 Clear cache targets completely instead of pruning idle files |
302
+ | `--developer`, `--not-developer`, `--forget-developer` | saved answer | Override or re-ask the developer question |
303
+ | `--scan-roots "P1;P2"`, `--exclude-path P` | auto | Section 17 roots and exclusions |
304
+ | `--hiberfil off\|reduced\|keep` | ask | What section 15 does |
305
+ | `--permanent` | off | Sections 18/19 delete instead of using the Recycle Bin |
306
+ | `--json`, `--quiet`, `--no-color`, `--ascii`, `--no-report`, `--cleanup-logs` | off | Output and record controls |
307
+
308
+ Every flag, exit code and environment variable:
309
+ [CLI reference](https://github.com/aoneahsan/windowsweep/blob/main/docs/cli-reference.md).
310
+
311
+ <a id="examples"></a>
312
+ ## 🧪 Examples&nbsp;[#](#examples)
313
+
314
+ | Goal | Command |
315
+ |---|---|
316
+ | See what is reclaimable, risk-free | `windowsweep --scan` |
317
+ | Rehearse tonight's cleanup | `windowsweep --dry-run --all --yes` |
318
+ | Reclaim the most space as a developer | `windowsweep --profile dev --yes` |
319
+ | Reclaim everything a non-developer can | `windowsweep --all --yes --not-developer` |
320
+ | Find `node_modules` in projects idle 6 months | `windowsweep --only 17 --days 180 --scan-roots "D:\work"` |
321
+ | Free the browser caches after closing the browsers | `windowsweep --only 7 --yes` |
322
+ | Run the admin sections | `windowsweep --profile system --yes --elevate` |
323
+ | Weekly unattended run | `windowsweep --install-task` |
324
+ | Machine-readable output for a script | `windowsweep --all --yes --json` |
325
+
326
+ <a id="advanced-features"></a>
327
+ ## 🎛️ Advanced Features&nbsp;[#](#advanced-features)
328
+
329
+ - **Profiles** - `dev`, `minimal`, `cache-only`, `system`, `deep`, `audit`.
330
+ [Docs](https://github.com/aoneahsan/windowsweep/blob/main/docs/profiles.md)
331
+ - **Keep-newest rule** - Cypress, Playwright, Gradle distributions and Squirrel app installs keep their newest
332
+ version whatever the idle gate says.
333
+ [Docs](https://github.com/aoneahsan/windowsweep/blob/main/docs/safety-model.md)
334
+ - **Editor hygiene** - workspace storage whose folder is gone and extension folders the editor's own
335
+ `extensions.json` no longer references.
336
+ [Docs](https://github.com/aoneahsan/windowsweep/blob/main/docs/sections.md)
337
+ - **Disk-image compaction** - hands back the space a Docker Desktop or WSL `.vhdx` never returns on its own.
338
+ [Docs](https://github.com/aoneahsan/windowsweep/blob/main/docs/admin-and-elevation.md)
339
+ - **Report export** - schema-versioned JSON to Markdown or a self-contained HTML page, no extra tools.
340
+ [Docs](https://github.com/aoneahsan/windowsweep/blob/main/docs/reports-and-logs.md)
341
+ - **Crash bundles** - captured locally on an unexpected exit, never transmitted.
342
+
343
+ <a id="recovery-troubleshooting"></a>
344
+ ## 🚑 Recovery & Troubleshooting&nbsp;[#](#recovery-troubleshooting)
345
+
346
+ | Symptom | Cause | Fix |
347
+ |---|---|---|
348
+ | `running scripts is disabled on this system` | `windowsweep.ps1` started directly under the `Restricted` policy | Use `npx windowsweep`, `windowsweep.cmd`, or `powershell -ExecutionPolicy Bypass -File windowsweep.ps1` |
349
+ | `REFUSE (inside protected: ...)` | The path resolves inside a protected folder | Working as designed; `--list-targets` shows the list |
350
+ | `skipped: chrome is running` | The browser or app is open | Close it and run the section again |
351
+ | `needs Administrator rights - skipped` | The console is not elevated | Add `--elevate`, or run the `system` profile |
352
+ | `The walkthrough needs an interactive console` | stdin is redirected | Use `--all --yes` or `--dry-run` |
353
+ | Reclaimed less than `--scan` showed | The idle gate kept recently used files; open apps were skipped | Lower `--days`, close the apps, or `--purge-all` |
354
+ | An extension folder was removed | The editor's `extensions.json` no longer referenced it | Reinstall from the editor; referenced folders are never touched |
355
+
356
+ More: [Troubleshooting](https://github.com/aoneahsan/windowsweep/blob/main/docs/troubleshooting.md).
357
+
358
+ <a id="limitations"></a>
359
+ ## 🚧 Limitations&nbsp;[#](#limitations)
360
+
361
+ - **No undo for caches.** They regenerate on next use; that is the whole design. Personal files use the Recycle
362
+ Bin instead.
363
+ - **Windows only.** Linux and macOS are blocked at install and at launch.
364
+ - **It cannot promise a number.** `--scan` measures your disk; the README will not guess.
365
+ - **The idle gate is conservative.** Windows keeps last-access times off on most volumes, so the tool reads the
366
+ newest of write, access and creation time - a file can only look fresher than it is, never older. Some old
367
+ caches survive the default window; `--days` and `--purge-all` exist for that.
368
+ - **Admin sections need an elevated console** and a UAC click; a Scheduled Task runs the safe batch only.
369
+ - **Disk Cleanup (section 13) cannot preview** how much it will free; its dry-run lists the handlers only.
370
+ - **No automated test suite beyond `--self-test`.** Correctness rests on the self-test's fixtures, dry-runs and
371
+ real runs on Windows 10 and 11.
372
+
373
+ <a id="faq"></a>
374
+ ## ❓ FAQ&nbsp;[#](#faq)
375
+
376
+ **Will it delete my code or documents?**
377
+ Not from a protected folder, and not without asking. Documents, Desktop, Pictures and cloud-sync folders are
378
+ hard refusals. Section 17 lists build artefacts in idle projects and removes only what you select.
379
+
380
+ **Does it phone home?**
381
+ No. Zero network calls, no telemetry, no update check. The self-test greps the source for HTTP and socket
382
+ calls; `--report-issue` opens your browser at a pre-filled page you submit yourself.
383
+
384
+ **Why keep files used in the last 100 days?**
385
+ Because a developer's caches are what make the next install fast. `--days 30` or `--purge-all` when you want
386
+ more, `--not-developer` when the machine has no development on it.
387
+
388
+ **Why is Chrome skipped?**
389
+ An open browser keeps its cache files locked and half-written. Close it and run `windowsweep --only 7 --yes`.
390
+
391
+ **Why PowerShell rather than an .exe?**
392
+ Every Windows machine has PowerShell 5.1: no runtime to install, no binary to trust, and the source is readable
393
+ in an afternoon.
394
+
395
+ More: [FAQ](https://github.com/aoneahsan/windowsweep/blob/main/docs/faq.md).
396
+
397
+ <a id="documentation"></a>
398
+ ## 📚 Documentation&nbsp;[#](#documentation)
399
+
400
+ | Document | Read it when |
401
+ |---|---|
402
+ | [Documentation index](https://github.com/aoneahsan/windowsweep/blob/main/docs/README.md) | you want the full map |
403
+ | [Quick start](https://github.com/aoneahsan/windowsweep/blob/main/docs/quick-start.md) | running your first cleanup |
404
+ | [Safety model](https://github.com/aoneahsan/windowsweep/blob/main/docs/safety-model.md) | you want every guarantee spelled out before deleting anything |
405
+ | [Developer mode](https://github.com/aoneahsan/windowsweep/blob/main/docs/developer-mode.md) | you want to know what the first question changes |
406
+ | [Sections 0-21](https://github.com/aoneahsan/windowsweep/blob/main/docs/sections.md) | you want to know precisely what one section touches |
407
+ | [CLI reference](https://github.com/aoneahsan/windowsweep/blob/main/docs/cli-reference.md) | you need an exact flag, exit code or variable |
408
+ | [Admin sections and elevation](https://github.com/aoneahsan/windowsweep/blob/main/docs/admin-and-elevation.md) | before running the system profile or touching the hibernation file |
409
+ | [Reports and logs](https://github.com/aoneahsan/windowsweep/blob/main/docs/reports-and-logs.md) | parsing the JSON or finding a log |
410
+ | [Troubleshooting](https://github.com/aoneahsan/windowsweep/blob/main/docs/troubleshooting.md) | something failed |
411
+
412
+ <a id="changelog"></a>
413
+ ## 🔄 Changelog&nbsp;[#](#changelog)
414
+
415
+ Latest release: **`1.0.0`** - first release: 22 sections, developer mode, the deletion chokepoint, dry-run, reports.
416
+ Full history: [CHANGELOG.md](https://github.com/aoneahsan/windowsweep/blob/main/CHANGELOG.md).
417
+
418
+ <a id="contributing"></a>
419
+ ## 🤝 Contributing&nbsp;[#](#contributing)
420
+
421
+ Fork and open a pull request - no special access needed. See
422
+ [CONTRIBUTING.md](https://github.com/aoneahsan/windowsweep/blob/main/CONTRIBUTING.md) for setup, the
423
+ safety-first coding standards, and how to request collaborator access. `main` is protected: every change lands
424
+ through a reviewed PR.
425
+
426
+ <a id="repository"></a>
427
+ ## 🗂️ Repository&nbsp;[#](#repository)
428
+
429
+ ```text
430
+ windowsweep.ps1 entry point: argument parsing and dispatch (published)
431
+ windowsweep.cmd launcher for machines without Node (published)
432
+ bin/ Node launcher used by npx and global install (published)
433
+ lib/ constants, UI, logging, filesystem walker, the safety chokepoint, config, scan, actions
434
+ modules/ one file per section group, plus walkthrough, menu, reports, self-test, crash trap
435
+ docs/ the manual (not shipped in the npm tarball)
436
+ assets/logo/ SVG logo masters
437
+ ```
438
+
439
+ <a id="support"></a>
440
+ ## 💬 Support&nbsp;[#](#support)
441
+
442
+ Questions and bugs: [open an issue](https://github.com/aoneahsan/windowsweep/issues). For a bug, run
443
+ `windowsweep --debug-bundle` first and attach the zip after reviewing it - it contains paths from your machine.
444
+ Security reports go privately to [aoneahsan@gmail.com](mailto:aoneahsan@gmail.com); see
445
+ [SECURITY.md](https://github.com/aoneahsan/windowsweep/blob/main/SECURITY.md).
446
+
447
+ If this tool saved you time, you can support its maintenance at
448
+ [aoneahsan.com/payment](https://aoneahsan.com/payment?project-id=windowsweep&project-identifier=windowsweep).
449
+
450
+ <a id="license"></a>
451
+ ## 📄 License&nbsp;[#](#license)
452
+
453
+ MIT © Ahsan Mahmood - see
454
+ [LICENSE](https://github.com/aoneahsan/windowsweep/blob/main/LICENSE). Provided "AS IS", without warranty;
455
+ this tool deletes files, so review what it proposes before confirming.
456
+
457
+ <a id="author"></a>
458
+ ## 👤 Author&nbsp;[#](#author)
459
+
460
+ **Ahsan Mahmood** - [aoneahsan.com](https://aoneahsan.com) · [GitHub](https://github.com/aoneahsan) ·
461
+ [LinkedIn](https://linkedin.com/in/aoneahsan) · [aoneahsan@gmail.com](mailto:aoneahsan@gmail.com)
462
+
463
+ <a id="links"></a>
464
+ ## 🔗 Links&nbsp;[#](#links)
465
+
466
+ | | |
467
+ |---|---|
468
+ | Documentation | https://github.com/aoneahsan/windowsweep/blob/main/docs/README.md |
469
+ | npm | https://www.npmjs.com/package/windowsweep |
470
+ | Repository | https://github.com/aoneahsan/windowsweep |
471
+ | Issues | https://github.com/aoneahsan/windowsweep/issues |
472
+ | Changelog | https://github.com/aoneahsan/windowsweep/blob/main/CHANGELOG.md |
473
+ | Contributing | https://github.com/aoneahsan/windowsweep/blob/main/CONTRIBUTING.md |
474
+ | Linux sibling | https://github.com/aoneahsan/linux-cleanup |
475
+ | macOS sibling | https://github.com/aoneahsan/macleanup |
476
+ | Support the project | https://aoneahsan.com/payment?project-id=windowsweep&project-identifier=windowsweep |
477
+
478
+ <a id="keywords"></a>
479
+ ## 🏷️ Keywords&nbsp;[#](#keywords)
480
+
481
+ *windows · cleanup · disk-cleanup · cache-cleanup · disk-space · temp-files · node-modules · npm-cache ·
482
+ yarn-cache · developer-tools · powershell · cli · dry-run*
package/SECURITY.md ADDED
@@ -0,0 +1,46 @@
1
+ # Security policy
2
+
3
+ windowsweep deletes files, stops and starts Windows services, runs `cleanmgr`, `Dism`, `powercfg`, `wevtutil`
4
+ and `diskpart` when elevated, and can move personal files to the Recycle Bin. Small bugs can have outsized
5
+ impact, so security reports are taken seriously.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ **Please do not open a public GitHub issue for security problems.**
10
+
11
+ Email <aoneahsan@gmail.com> with:
12
+
13
+ 1. The problem class (a deletion outside a declared target, a way past `--dry-run`, a junction or symlink
14
+ that is followed, command injection through a path or file name, personal data written into a log or
15
+ report, an unintended elevated command).
16
+ 2. Steps to reproduce: the command line, the folder layout, observed and expected behaviour.
17
+ 3. Your impact assessment.
18
+ 4. Whether you would like to be credited in the changelog.
19
+
20
+ You will normally receive an acknowledgement within 5 working days. This is a single-author project without a
21
+ formal SLA; critical issues are triaged ahead of feature work.
22
+
23
+ ## In scope
24
+
25
+ - Anything in `windowsweep.ps1`, `lib/` or `modules/` that could delete outside the target its section
26
+ declared, bypass the `--dry-run` guarantee, follow a reparse point, run an unintended elevated command, or
27
+ leak personal data into a log, report or bundle that the user did not opt into.
28
+ - The Node launcher (`bin/windowsweep.js`) and the `.cmd` launcher.
29
+
30
+ ## Out of scope
31
+
32
+ - Files the user selected and confirmed in sections 17, 18 or 19.
33
+ - Access-denied errors when running admin sections without elevation.
34
+ - Behaviour of the third-party tools the script invokes (`docker`, `npm`, `cleanmgr`, `Dism`, ...).
35
+ - A forked or edited copy of the script.
36
+
37
+ ## Coordinated disclosure
38
+
39
+ If a fix needs non-trivial work, the author may ask you to hold public disclosure for up to 30 days while a
40
+ patch is released. Credit, if wanted, lands in the matching `CHANGELOG.md` entry.
41
+
42
+ ## Defensive guidance for users
43
+
44
+ - Run `--self-test`, then `--scan`, then `--dry-run` before the first real run on any machine.
45
+ - Keep a backup before running any cleanup tool. Sections 11, 15, 16 and 20 are deliberately gated.
46
+ - Read the session log under `~\.windowsweep\logs\` when anything surprises you; every deletion is recorded.
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0