Windows cleanup planner ยท Dry-run first ยท AI-native MCP integration
AI-friendly Windows cleanup CLI with safe dry-runs, reusable cleanup plans, read-only inventory reports, governed execution gates, and machine-readable contracts for agents and automation.
# ๐งช Safe preview
python3 cleanwin.py --json inspect --categories temp,dev-cache,package-cache,browser-cache,app-leftovers --max-items 10
# ๐งญ Create a reusable cleanup plan
python3 cleanwin.py --json plan --categories temp,dev-cache,app-leftovers --older-than-days 7 --output /tmp/cleanwin-plan.json
# โ
Validate and review before any execution
python3 cleanwin.py --json validate-plan --plan-file /tmp/cleanwin-plan.json
python3 cleanwin.py --json review-plan --plan-file /tmp/cleanwin-plan.json
# ๐ค AI tool definitions (12 tools)
python3 cleanwin.py --json ai-tools --provider anthropic
# ๐๏ธ MCP stdio server
python3 -m cleancli.mcp_server๐ก๏ธ Safety principle: Nothing is deleted by default.
execute-planwithout--executeis always a dry-run. Real execution requires a validated plan,--execute,--yes, an operation log, recycle mode, the exact confirmation phrase, and a dry-run confirmation token.
| ๐ท๏ธ | Description |
|---|---|
| ๐งน Dry-run first | Inspect, plan, validate, review, and dry-run are the default workflow |
| ๐ช Windows-aware safety | Protects Windows roots, user libraries, credentials, browser profiles, WSL, Docker, and servicing stores |
| ๐๏ธ Uninstall leftover cleanup | Expands safe cleanup for reviewed common app cache/log leftovers after uninstall, including Electron apps, IDEs, text editors, Git clients, database/API clients, network debugging tools, Kubernetes/container desktop tools, virtualization/emulator tools, local AI/model tools, remote access/VPN tools, game streaming tools, game launchers, sync/backup clients, backup clients, cloud transfer clients, media servers, eBook/audiobook apps, audio/media players, search tools, password managers, PDF readers, mail clients, reference managers, note apps, collaboration/chat/meeting tools, terminal caches, terminal/SSH client diagnostics, transfer clients, archive tools, boot media/image writer tools, screenshot/scanner tools, live capture tools, audio workstation tools, 3D printing/modeling/CAD tools, image viewers, image/media tools, video editors, design tools, Markdown tools, cleaner utilities, disk analyzers, hardware diagnostics, OEM support tools, creator utilities, printing utilities, peripheral utilities, security tools, and diagnostic logs |
| โป๏ธ Recycle by default | Real cleanup routes to Windows Recycle Bin; non-Windows execution fails closed outside test mode |
| ๐งพ Plan contract | cleanwin.plan.v1 captures source fingerprint, host/user context, rule metadata, and filesystem identity |
| ๐ค AI-native ยท 12 tools | Provider exports for Anthropic / OpenAI plus workflow routing, environment indexing, host-policy simulation, and readiness reports |
| ๐๏ธ MCP Server | Built-in Model Context Protocol stdio server with structured tool arguments only |
| ๐ Multi-layer gates | Confirmation phrase, dry-run token, operation log, context validation, and single deletion exit |
| ๐ฆ Zero deps | Pure Python 3.10+, no runtime dependencies |
| Guide | Link |
|---|---|
| ๐ English โ full CLI reference, safety model, AI/MCP patterns, development | docs/doc/README.md |
| ๐ ไธญๆ โ ๅฎๆดๅฝไปคๅ่ใๅฎๅ จๆจกๅใAI/MCP ่ฐ็จๅงฟๅฟใๅผๅ้ช่ฏ | docs/doc/README.CN.md |
| ๐ค Agent workflow โ repository guardrails for AI coding agents and maintainers | AGENTS.md |
- ๐ก๏ธ Safety Model
- ๐งน Cleanup Categories
- ๐ป CLI Reference
- ๐ค AI Invocation Patterns
- ๐๏ธ MCP Server
- โ Development & CI
- ๐ค Agent Workflow
- ๐ ไธญๆๅฎๅ จๆจกๅ
- ๐ ไธญๆ AI ่ฐ็จๅงฟๅฟ
# โถ๏ธ Run directly
python3 cleanwin.py --json capabilities
# ๐ช Install from the Windows portable release
# Download cleanwin-<version>-windows-x64.zip from GitHub Releases, unzip it,
# then run:
.\cleanwin.exe --json doctor
.\cleanwin.exe --json inspect --categories temp,dev-cache --max-items 10
# ๐ฆ Scoop (recommended for Windows users)
scoop bucket add cleanwin https://github.com/imajinyun/cleanwin-bucket
scoop install cleanwin
cleanwin --json doctor
# ๐งฐ Install the Windows portable release into the user PATH
irm https://github.com/imajinyun/cleanwin/releases/latest/download/install.ps1 -OutFile install-cleanwin.ps1
powershell -ExecutionPolicy Bypass -File .\install-cleanwin.ps1
cleanwin --json doctor
# ๐ฆ Install from PyPI with pipx after publication
pipx install cleanwin
cleanwin --json doctor
cleanwin-mcp
# ๐ฅ Install as editable package
python3 -m pip install -e .
cleanwin --json capabilities
cleanwin-mcpRequires Python 3.10+. Runtime dependencies: none.
Windows portable releases are produced as cleanwin-<version>-windows-x64.zip
with cleanwin.exe, cleanwin-mcp.exe, LICENSE, README.md, and a SHA256
checksum. install.ps1 is attached to the GitHub Release; download it first,
then run it locally. It downloads the latest portable release, verifies the
published checksum, installs under %LOCALAPPDATA%\Programs\cleanwin, updates
the user PATH, and runs cleanwin.exe --json doctor.
To upgrade, run the installer again โ it detects an existing cleanwin install
and replaces it in place. You can also use the built-in self-update command:
cleanwin --json self-update --executeTo uninstall:
powershell -ExecutionPolicy Bypass -File .\install-cleanwin.ps1 -UninstallThe cleanwin-bucket repo hosts a Scoop bucket for cleanwin. Download URLs include mainland China mirrors with GitHub as fallback.
scoop bucket add cleanwin https://github.com/imajinyun/cleanwin-bucket
scoop install cleanwin
scoop update cleanwin
scoop uninstall cleanwinThe bucket is automatically updated on every cleanwin release via
repository_dispatch.
Use the repository Makefile so tooling is installed and executed inside .venv:
make lint
make pytest
make type
make compile
make ci-smokemake ci-smoke mirrors the Linux CI quality gate. make quality runs the full
local gate, including packaging, smoke checks, and cleanup. make pytest and
make pytest-governance-smoke remove pytest caches, coverage files, and
__pycache__ after pytest finishes while preserving the test exit code. .venv
is kept as the managed tool environment, not treated as a test leftover. Use
make clean for build/cache cleanup and make docker-quality when Docker is
installed and image pulls are allowed. See AGENTS.md for the full
agent workflow.
cleanwin is released under the MIT License.