Skip to content

imajinyun/cleanwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

305 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงน cleanwin

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.


๐Ÿš€ TL;DR

# ๐Ÿงช 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-plan without --execute is 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.


โœจ Highlights

๐Ÿท๏ธ 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

๐Ÿ“– Documentation

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

๐Ÿงฉ Quick Index


๐Ÿ’ป Installation

# โ–ถ๏ธ 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-mcp

Requires 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 --execute

To uninstall:

powershell -ExecutionPolicy Bypass -File .\install-cleanwin.ps1 -Uninstall

Scoop

The 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 cleanwin

The bucket is automatically updated on every cleanwin release via repository_dispatch.


โœ… Development Workflow

Use the repository Makefile so tooling is installed and executed inside .venv:

make lint
make pytest
make type
make compile
make ci-smoke

make 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.


๐Ÿ“„ License

cleanwin is released under the MIT License.


๐Ÿ”— Links

About

๐Ÿ›ก๏ธ AI-friendly Windows cleanup CLI with safe dry-run plans, governed execution, inventory reports, and machine-readable cleanup contracts.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors