win-dev-doctor 0.2.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.
- win_dev_doctor-0.2.0/.github/ISSUE_TEMPLATE/new-check.md +16 -0
- win_dev_doctor-0.2.0/.github/workflows/ci.yml +31 -0
- win_dev_doctor-0.2.0/.gitignore +13 -0
- win_dev_doctor-0.2.0/CONTRIBUTING.md +65 -0
- win_dev_doctor-0.2.0/LICENSE +21 -0
- win_dev_doctor-0.2.0/PKG-INFO +145 -0
- win_dev_doctor-0.2.0/README.md +112 -0
- win_dev_doctor-0.2.0/assets/demo.svg +29 -0
- win_dev_doctor-0.2.0/pyproject.toml +63 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/__init__.py +3 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/__main__.py +6 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/__init__.py +5 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/caches.py +149 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/defender.py +133 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/dev_tools.py +88 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/env_vars.py +75 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/git_config.py +85 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/long_paths.py +61 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/path_health.py +120 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/ports.py +182 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/symlinks.py +69 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/checks/wsl.py +71 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/cli.py +435 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/mcp_server.py +293 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/models.py +59 -0
- win_dev_doctor-0.2.0/src/win_dev_doctor/registry.py +37 -0
- win_dev_doctor-0.2.0/tests/test_caches.py +33 -0
- win_dev_doctor-0.2.0/tests/test_cli.py +58 -0
- win_dev_doctor-0.2.0/tests/test_defender.py +37 -0
- win_dev_doctor-0.2.0/tests/test_env_vars.py +28 -0
- win_dev_doctor-0.2.0/tests/test_mcp.py +81 -0
- win_dev_doctor-0.2.0/tests/test_path_health.py +38 -0
- win_dev_doctor-0.2.0/tests/test_ports.py +20 -0
- win_dev_doctor-0.2.0/tests/test_registry.py +30 -0
- win_dev_doctor-0.2.0/uv.lock +534 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: New Check Idea
|
|
3
|
+
about: Propose a new diagnostic check for Windows developers
|
|
4
|
+
title: "[check] "
|
|
5
|
+
labels: enhancement, good first issue
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### What problem does this check solve?
|
|
10
|
+
Describe the Windows developer pain point (e.g. Docker WSL memory limits, Rust MSVC linker missing, VS Code shell integration).
|
|
11
|
+
|
|
12
|
+
### What should the check inspect?
|
|
13
|
+
- Registry key / command / file path / env var:
|
|
14
|
+
|
|
15
|
+
### Suggested fix hint
|
|
16
|
+
What exact command or setting fixes the issue?
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: windows-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
run: uv python install ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: uv sync --extra dev --python ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Lint with Ruff
|
|
28
|
+
run: uv run --python ${{ matrix.python-version }} ruff check src tests
|
|
29
|
+
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: uv run --python ${{ matrix.python-version }} pytest -v
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Contributing to `win-dev-doctor`
|
|
2
|
+
|
|
3
|
+
Thanks for helping make Windows development smoother!
|
|
4
|
+
|
|
5
|
+
`win-dev-doctor` is built around a **1 file = 1 check** plugin architecture. Adding a new check takes under 5 minutes and requires **zero central registration**.
|
|
6
|
+
|
|
7
|
+
## Quickstart (Dev Setup)
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
git clone https://github.com/reillywalter/win-dev-doctor.git
|
|
11
|
+
cd win-dev-doctor
|
|
12
|
+
uv sync --extra dev
|
|
13
|
+
uv run pytest
|
|
14
|
+
uv run wdd check
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Adding a New Check
|
|
18
|
+
|
|
19
|
+
1. Create a new file in `src/win_dev_doctor/checks/<your_check>.py`.
|
|
20
|
+
2. Subclass `BaseCheck` from `win_dev_doctor.models`:
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from win_dev_doctor.models import BaseCheck, CheckResult, Status
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MyToolCheck(BaseCheck):
|
|
27
|
+
id = "my-tool"
|
|
28
|
+
name = "My Tool Check"
|
|
29
|
+
category = "toolchain"
|
|
30
|
+
description = "Verify My Tool is configured properly on Windows."
|
|
31
|
+
order = 80
|
|
32
|
+
|
|
33
|
+
def run(self) -> CheckResult:
|
|
34
|
+
return CheckResult(
|
|
35
|
+
check_id=self.id,
|
|
36
|
+
name=self.name,
|
|
37
|
+
category=self.category,
|
|
38
|
+
status=Status.OK,
|
|
39
|
+
summary="Everything looks good",
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. Verify it is auto-discovered:
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
uv run wdd list
|
|
47
|
+
uv run wdd check --only my-tool
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
4. Add a unit test under `tests/` and run:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
uv run ruff check src tests
|
|
54
|
+
uv run pytest
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
5. Open a Pull Request!
|
|
58
|
+
|
|
59
|
+
## Ideas for Good First Checks
|
|
60
|
+
- `msvc`: Check Visual Studio Build Tools / C++ linker availability for Rust & Python native wheels.
|
|
61
|
+
- `docker`: Check Docker Desktop / WSL2 `.wslconfig` memory limits.
|
|
62
|
+
- `ssh`: Verify Windows OpenSSH Agent service status.
|
|
63
|
+
- `winget`: Check outdated developer packages via `winget upgrade`.
|
|
64
|
+
- `defender`: Check if dev workspace folders have Windows Defender exclusions.
|
|
65
|
+
- `powershell`: Check PowerShell execution policy and profile load time.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Reilly Walter
|
|
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,145 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: win-dev-doctor
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Fast, modular CLI & MCP doctor for Windows developers — diagnose PATH, kill stuck ports, check dev config, and reclaim cache space.
|
|
5
|
+
Project-URL: Homepage, https://github.com/reillywalter/win-dev-doctor
|
|
6
|
+
Project-URL: Repository, https://github.com/reillywalter/win-dev-doctor
|
|
7
|
+
Project-URL: Issues, https://github.com/reillywalter/win-dev-doctor/issues
|
|
8
|
+
Author: Reilly Walter
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cache,claude,cli,developer-tools,diagnostics,doctor,mcp,path,ports,windows
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Topic :: System :: Systems Administration
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: psutil>=6.0.0
|
|
27
|
+
Requires-Dist: rich>=13.7.0
|
|
28
|
+
Requires-Dist: typer>=0.12.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.6.0; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# win-dev-doctor (`wdd`)
|
|
35
|
+
|
|
36
|
+
> Fast, modular **CLI & MCP doctor** for Windows developers — audit `PATH`, kill stuck ports, inspect Windows dev config, reclaim gigabytes of cache space, and connect straight to **Claude Code / Cursor / Antigravity** via MCP.
|
|
37
|
+
|
|
38
|
+
[](https://github.com/reillywalter/win-dev-doctor/actions/workflows/ci.yml)
|
|
39
|
+
[](https://www.python.org/downloads/)
|
|
40
|
+
[](#mcp-server-for-claude-code--cursor)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
## Why?
|
|
46
|
+
|
|
47
|
+
Developing on Windows comes with recurring friction:
|
|
48
|
+
- *"Port 3000 is already in use"* -> hunting PIDs with `netstat -ano | findstr` + Task Manager.
|
|
49
|
+
- Broken, duplicated, or shadowed `python.exe` / `node.exe` entries in `PATH`.
|
|
50
|
+
- `MAX_PATH` (260-char) crashes in `git`, `cargo`, `pip`, or `node_modules`.
|
|
51
|
+
- Symlink errors because Developer Mode is off.
|
|
52
|
+
- Slow builds because Windows Defender scans `repos/` and `.cargo/`.
|
|
53
|
+
- Gigabytes silently buried in `pip`, `uv`, `npm`, `pnpm`, `cargo`, and `gradle` caches.
|
|
54
|
+
|
|
55
|
+
**`wdd`** catches and fixes all of them from one tiny CLI — and exposes the same diagnostics as an **MCP server** so your AI coding agent can troubleshoot Windows for you.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
# With uv (recommended)
|
|
61
|
+
uv tool install git+https://github.com/reillywalter/win-dev-doctor
|
|
62
|
+
|
|
63
|
+
# Or clone & run locally
|
|
64
|
+
git clone https://github.com/reillywalter/win-dev-doctor.git
|
|
65
|
+
cd win-dev-doctor
|
|
66
|
+
uv sync
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
### Run all health checks
|
|
72
|
+
```powershell
|
|
73
|
+
wdd check
|
|
74
|
+
wdd check --verbose
|
|
75
|
+
wdd check --only path,env,long-paths,git
|
|
76
|
+
wdd check --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Generate a shareable Markdown report (auto-redacts username)
|
|
80
|
+
```powershell
|
|
81
|
+
wdd report -o doctor-report.md
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Inspect & kill stuck ports
|
|
85
|
+
```powershell
|
|
86
|
+
wdd ports # Common dev ports (3000, 5173, 8000, 8080, ...)
|
|
87
|
+
wdd ports --all # Every listening TCP port
|
|
88
|
+
wdd kill 3000 # Gracefully terminate whatever owns port 3000
|
|
89
|
+
wdd kill 3000 -f -y # Force-kill without prompt
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Audit your Windows `PATH`
|
|
93
|
+
```powershell
|
|
94
|
+
wdd path # Missing dirs, duplicates, shadowed binaries
|
|
95
|
+
wdd path --all # Full resolution order
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Reclaim developer cache space
|
|
99
|
+
```powershell
|
|
100
|
+
wdd clean --dry-run # Preview pip, uv, npm, pnpm, yarn, cargo, ruff, gradle, nuget
|
|
101
|
+
wdd clean # Interactive cleanup
|
|
102
|
+
wdd clean -t pip,uv -y # Clean specific caches immediately
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## MCP Server (for Claude Code / Cursor)
|
|
106
|
+
|
|
107
|
+
Run `wdd mcp` to start a zero-dependency stdio MCP server exposing `run_health_check`, `inspect_path`, `list_ports`, `kill_port`, `scan_caches`, and `clean_caches`.
|
|
108
|
+
|
|
109
|
+
Add to your MCP config (`claude_desktop_config.json`, `.mcp.json`, or Cursor MCP settings):
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"win-dev-doctor": {
|
|
115
|
+
"command": "wdd",
|
|
116
|
+
"args": ["mcp"]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Built-in Checks
|
|
123
|
+
|
|
124
|
+
| ID | Category | What it checks |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| `path` | environment | Missing folders, duplicate entries, shadowed dev binaries in `PATH` |
|
|
127
|
+
| `env` | environment | `TEMP`/`TMP` validity, global `PYTHONHOME`/`PYTHONPATH` leaks, active proxies |
|
|
128
|
+
| `long-paths` | windows | `LongPathsEnabled` registry flag (`>260` char paths) |
|
|
129
|
+
| `symlinks` | windows | Developer Mode & non-admin symlink creation |
|
|
130
|
+
| `tools` | toolchain | Installed versions of `git`, `python`, `uv`, `node`, `rustc`, `go`, `docker`, `winget`, `pwsh` |
|
|
131
|
+
| `git` | toolchain | Global identity, `core.longpaths`, `core.autocrlf` |
|
|
132
|
+
| `wsl` | windows | WSL availability and installed Linux distros |
|
|
133
|
+
| `ports` | runtime | Active processes occupying common local dev ports |
|
|
134
|
+
| `caches` | disk | Reclaimable disk space across package manager caches |
|
|
135
|
+
| `defender` | performance | Windows Defender exclusions for common dev folders |
|
|
136
|
+
|
|
137
|
+
## Contributing (1 File = 1 Check)
|
|
138
|
+
|
|
139
|
+
Want to add a check for MSVC Build Tools, Docker/WSL2 memory limits, OpenSSH Agent, Scoop, or VS Code?
|
|
140
|
+
|
|
141
|
+
Drop a single file in `src/win_dev_doctor/checks/` subclassing `BaseCheck` — the registry discovers it automatically. Check open [`good first issue`](https://github.com/reillywalter/win-dev-doctor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) tickets and [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# win-dev-doctor (`wdd`)
|
|
2
|
+
|
|
3
|
+
> Fast, modular **CLI & MCP doctor** for Windows developers — audit `PATH`, kill stuck ports, inspect Windows dev config, reclaim gigabytes of cache space, and connect straight to **Claude Code / Cursor / Antigravity** via MCP.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/reillywalter/win-dev-doctor/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
[](#mcp-server-for-claude-code--cursor)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## Why?
|
|
13
|
+
|
|
14
|
+
Developing on Windows comes with recurring friction:
|
|
15
|
+
- *"Port 3000 is already in use"* -> hunting PIDs with `netstat -ano | findstr` + Task Manager.
|
|
16
|
+
- Broken, duplicated, or shadowed `python.exe` / `node.exe` entries in `PATH`.
|
|
17
|
+
- `MAX_PATH` (260-char) crashes in `git`, `cargo`, `pip`, or `node_modules`.
|
|
18
|
+
- Symlink errors because Developer Mode is off.
|
|
19
|
+
- Slow builds because Windows Defender scans `repos/` and `.cargo/`.
|
|
20
|
+
- Gigabytes silently buried in `pip`, `uv`, `npm`, `pnpm`, `cargo`, and `gradle` caches.
|
|
21
|
+
|
|
22
|
+
**`wdd`** catches and fixes all of them from one tiny CLI — and exposes the same diagnostics as an **MCP server** so your AI coding agent can troubleshoot Windows for you.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
# With uv (recommended)
|
|
28
|
+
uv tool install git+https://github.com/reillywalter/win-dev-doctor
|
|
29
|
+
|
|
30
|
+
# Or clone & run locally
|
|
31
|
+
git clone https://github.com/reillywalter/win-dev-doctor.git
|
|
32
|
+
cd win-dev-doctor
|
|
33
|
+
uv sync
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Run all health checks
|
|
39
|
+
```powershell
|
|
40
|
+
wdd check
|
|
41
|
+
wdd check --verbose
|
|
42
|
+
wdd check --only path,env,long-paths,git
|
|
43
|
+
wdd check --json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Generate a shareable Markdown report (auto-redacts username)
|
|
47
|
+
```powershell
|
|
48
|
+
wdd report -o doctor-report.md
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Inspect & kill stuck ports
|
|
52
|
+
```powershell
|
|
53
|
+
wdd ports # Common dev ports (3000, 5173, 8000, 8080, ...)
|
|
54
|
+
wdd ports --all # Every listening TCP port
|
|
55
|
+
wdd kill 3000 # Gracefully terminate whatever owns port 3000
|
|
56
|
+
wdd kill 3000 -f -y # Force-kill without prompt
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Audit your Windows `PATH`
|
|
60
|
+
```powershell
|
|
61
|
+
wdd path # Missing dirs, duplicates, shadowed binaries
|
|
62
|
+
wdd path --all # Full resolution order
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Reclaim developer cache space
|
|
66
|
+
```powershell
|
|
67
|
+
wdd clean --dry-run # Preview pip, uv, npm, pnpm, yarn, cargo, ruff, gradle, nuget
|
|
68
|
+
wdd clean # Interactive cleanup
|
|
69
|
+
wdd clean -t pip,uv -y # Clean specific caches immediately
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## MCP Server (for Claude Code / Cursor)
|
|
73
|
+
|
|
74
|
+
Run `wdd mcp` to start a zero-dependency stdio MCP server exposing `run_health_check`, `inspect_path`, `list_ports`, `kill_port`, `scan_caches`, and `clean_caches`.
|
|
75
|
+
|
|
76
|
+
Add to your MCP config (`claude_desktop_config.json`, `.mcp.json`, or Cursor MCP settings):
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"win-dev-doctor": {
|
|
82
|
+
"command": "wdd",
|
|
83
|
+
"args": ["mcp"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Built-in Checks
|
|
90
|
+
|
|
91
|
+
| ID | Category | What it checks |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `path` | environment | Missing folders, duplicate entries, shadowed dev binaries in `PATH` |
|
|
94
|
+
| `env` | environment | `TEMP`/`TMP` validity, global `PYTHONHOME`/`PYTHONPATH` leaks, active proxies |
|
|
95
|
+
| `long-paths` | windows | `LongPathsEnabled` registry flag (`>260` char paths) |
|
|
96
|
+
| `symlinks` | windows | Developer Mode & non-admin symlink creation |
|
|
97
|
+
| `tools` | toolchain | Installed versions of `git`, `python`, `uv`, `node`, `rustc`, `go`, `docker`, `winget`, `pwsh` |
|
|
98
|
+
| `git` | toolchain | Global identity, `core.longpaths`, `core.autocrlf` |
|
|
99
|
+
| `wsl` | windows | WSL availability and installed Linux distros |
|
|
100
|
+
| `ports` | runtime | Active processes occupying common local dev ports |
|
|
101
|
+
| `caches` | disk | Reclaimable disk space across package manager caches |
|
|
102
|
+
| `defender` | performance | Windows Defender exclusions for common dev folders |
|
|
103
|
+
|
|
104
|
+
## Contributing (1 File = 1 Check)
|
|
105
|
+
|
|
106
|
+
Want to add a check for MSVC Build Tools, Docker/WSL2 memory limits, OpenSSH Agent, Scoop, or VS Code?
|
|
107
|
+
|
|
108
|
+
Drop a single file in `src/win_dev_doctor/checks/` subclassing `BaseCheck` — the registry discovers it automatically. Check open [`good first issue`](https://github.com/reillywalter/win-dev-doctor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) tickets and [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="840" height="430" viewBox="0 0 840 430" role="img" aria-label="win-dev-doctor terminal demo">
|
|
2
|
+
<rect width="840" height="430" rx="12" fill="#0d1117" stroke="#30363d" stroke-width="1.5"/>
|
|
3
|
+
<rect width="840" height="36" rx="12" fill="#161b22"/>
|
|
4
|
+
<rect y="24" width="840" height="12" fill="#161b22"/>
|
|
5
|
+
<circle cx="22" cy="18" r="6" fill="#ff5f56"/>
|
|
6
|
+
<circle cx="42" cy="18" r="6" fill="#ffbd2e"/>
|
|
7
|
+
<circle cx="62" cy="18" r="6" fill="#27c93f"/>
|
|
8
|
+
<text x="420" y="22" text-anchor="middle" fill="#8b949e" font-family="Consolas, 'Cascadia Code', monospace" font-size="13">Windows PowerShell — wdd check</text>
|
|
9
|
+
|
|
10
|
+
<g font-family="Consolas, 'Cascadia Code', monospace" font-size="13.5">
|
|
11
|
+
<text x="24" y="66" fill="#38bdf8">PS C:\dev> <tspan fill="#f0f6fc">wdd check</tspan></text>
|
|
12
|
+
<text x="24" y="96" fill="#8b949e"> win-dev-doctor v0.2.0</text>
|
|
13
|
+
<text x="24" y="118" fill="#484f58">┌────────┬───────────────────────────┬──────────────────────────────────────────┐</text>
|
|
14
|
+
<text x="24" y="138" fill="#484f58">│ <tspan fill="#f0f6fc">Status</tspan> │ <tspan fill="#f0f6fc">Check</tspan> │ <tspan fill="#f0f6fc">Summary</tspan> │</text>
|
|
15
|
+
<text x="24" y="158" fill="#484f58">├────────┼───────────────────────────┼──────────────────────────────────────────┤</text>
|
|
16
|
+
<text x="24" y="178" fill="#484f58">│ <tspan fill="#eab308">WARN</tspan> │ <tspan fill="#f0f6fc">PATH Health</tspan> │ <tspan fill="#c9d1d9">2 missing, 1 duplicate, 1 shadowed</tspan> │</text>
|
|
17
|
+
<text x="24" y="198" fill="#484f58">│ <tspan fill="#22c55e">OK</tspan> │ <tspan fill="#f0f6fc">Dev Env Variables</tspan> │ <tspan fill="#c9d1d9">TEMP/TMP valid; no Python env leaks</tspan> │</text>
|
|
18
|
+
<text x="24" y="218" fill="#484f58">│ <tspan fill="#eab308">WARN</tspan> │ <tspan fill="#f0f6fc">Windows Long Paths</tspan> │ <tspan fill="#c9d1d9">LongPathsEnabled=0 (breaks node/cargo)</tspan> │</text>
|
|
19
|
+
<text x="24" y="238" fill="#484f58">│ <tspan fill="#22c55e">OK</tspan> │ <tspan fill="#f0f6fc">Developer Mode & Symlinks</tspan> │ <tspan fill="#c9d1d9">Symlinks work without elevation</tspan> │</text>
|
|
20
|
+
<text x="24" y="258" fill="#484f58">│ <tspan fill="#38bdf8">INFO</tspan> │ <tspan fill="#f0f6fc">Active Dev Ports</tspan> │ <tspan fill="#c9d1d9">:3000 -> node.exe (PID 18420)</tspan> │</text>
|
|
21
|
+
<text x="24" y="278" fill="#484f58">│ <tspan fill="#eab308">WARN</tspan> │ <tspan fill="#f0f6fc">Developer Caches</tspan> │ <tspan fill="#c9d1d9">4.8 GB across uv, pip, npm, cargo</tspan> │</text>
|
|
22
|
+
<text x="24" y="298" fill="#484f58">│ <tspan fill="#eab308">WARN</tspan> │ <tspan fill="#f0f6fc">Defender Exclusions</tspan> │ <tspan fill="#c9d1d9">2 of 4 dev folders not excluded</tspan> │</text>
|
|
23
|
+
<text x="24" y="318" fill="#484f58">└────────┴───────────────────────────┴──────────────────────────────────────────┘</text>
|
|
24
|
+
|
|
25
|
+
<text x="24" y="352" fill="#38bdf8">PS C:\dev> <tspan fill="#f0f6fc">wdd kill 3000 -y</tspan></text>
|
|
26
|
+
<text x="24" y="374" fill="#22c55e">Killed <tspan fill="#f0f6fc">node.exe (PID 18420) on port 3000</tspan></text>
|
|
27
|
+
<text x="24" y="404" fill="#38bdf8">PS C:\dev> <tspan fill="#f0f6fc">wdd mcp</tspan> <tspan fill="#8b949e"># Ready for Claude Code / Cursor / Antigravity over stdio</tspan></text>
|
|
28
|
+
</g>
|
|
29
|
+
</svg>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25.0"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "win-dev-doctor"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Fast, modular CLI & MCP doctor for Windows developers — diagnose PATH, kill stuck ports, check dev config, and reclaim cache space."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Reilly Walter" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["windows", "cli", "mcp", "claude", "developer-tools", "diagnostics", "ports", "path", "cache", "doctor"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: Microsoft :: Windows",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
28
|
+
"Topic :: System :: Systems Administration",
|
|
29
|
+
"Topic :: Utilities",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"psutil>=6.0.0",
|
|
33
|
+
"rich>=13.7.0",
|
|
34
|
+
"typer>=0.12.0",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = [
|
|
39
|
+
"pytest>=8.0.0",
|
|
40
|
+
"ruff>=0.6.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/reillywalter/win-dev-doctor"
|
|
45
|
+
Repository = "https://github.com/reillywalter/win-dev-doctor"
|
|
46
|
+
Issues = "https://github.com/reillywalter/win-dev-doctor/issues"
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
wdd = "win_dev_doctor.cli:main"
|
|
50
|
+
win-dev-doctor = "win_dev_doctor.cli:main"
|
|
51
|
+
|
|
52
|
+
[tool.hatch.build.targets.wheel]
|
|
53
|
+
packages = ["src/win_dev_doctor"]
|
|
54
|
+
|
|
55
|
+
[tool.ruff]
|
|
56
|
+
line-length = 110
|
|
57
|
+
target-version = "py310"
|
|
58
|
+
|
|
59
|
+
[tool.ruff.lint]
|
|
60
|
+
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
61
|
+
|
|
62
|
+
[tool.pytest.ini_options]
|
|
63
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""Discover, measure, and safely clean Windows developer package caches."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import shutil
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from win_dev_doctor.models import BaseCheck, CheckResult, Status
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(slots=True)
|
|
14
|
+
class CacheTarget:
|
|
15
|
+
"""A known developer cache directory."""
|
|
16
|
+
|
|
17
|
+
id: str
|
|
18
|
+
name: str
|
|
19
|
+
path: Path
|
|
20
|
+
size_bytes: int = 0
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def format_bytes(num_bytes: int) -> str:
|
|
24
|
+
"""Format byte count into human-readable units."""
|
|
25
|
+
value = float(num_bytes)
|
|
26
|
+
for unit in ("B", "KB", "MB", "GB", "TB"):
|
|
27
|
+
if value < 1024.0 or unit == "TB":
|
|
28
|
+
return f"{value:.1f} {unit}" if unit != "B" else f"{int(value)} B"
|
|
29
|
+
value /= 1024.0
|
|
30
|
+
return f"{num_bytes} B"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def directory_size(path: Path) -> int:
|
|
34
|
+
"""Fast, symlink-safe recursive directory size calculation."""
|
|
35
|
+
total = 0
|
|
36
|
+
stack: list[Path] = [path]
|
|
37
|
+
while stack:
|
|
38
|
+
current = stack.pop()
|
|
39
|
+
try:
|
|
40
|
+
with os.scandir(current) as it:
|
|
41
|
+
for entry in it:
|
|
42
|
+
try:
|
|
43
|
+
if entry.is_symlink():
|
|
44
|
+
continue
|
|
45
|
+
if entry.is_file(follow_symlinks=False):
|
|
46
|
+
total += entry.stat(follow_symlinks=False).st_size
|
|
47
|
+
elif entry.is_dir(follow_symlinks=False):
|
|
48
|
+
stack.append(Path(entry.path))
|
|
49
|
+
except OSError:
|
|
50
|
+
continue
|
|
51
|
+
except OSError:
|
|
52
|
+
continue
|
|
53
|
+
return total
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _candidate_cache_dirs() -> list[tuple[str, str, Path]]:
|
|
57
|
+
home = Path.home()
|
|
58
|
+
local_app = Path(os.environ.get("LOCALAPPDATA", home / "AppData" / "Local"))
|
|
59
|
+
roaming_app = Path(os.environ.get("APPDATA", home / "AppData" / "Roaming"))
|
|
60
|
+
|
|
61
|
+
return [
|
|
62
|
+
("pip", "pip cache", local_app / "pip" / "Cache"),
|
|
63
|
+
("uv", "uv cache", local_app / "uv" / "cache"),
|
|
64
|
+
("npm", "npm cache", local_app / "npm-cache"),
|
|
65
|
+
("npm-roaming", "npm cache (Roaming)", roaming_app / "npm-cache"),
|
|
66
|
+
("pnpm", "pnpm store", local_app / "pnpm" / "store"),
|
|
67
|
+
("yarn", "Yarn cache", local_app / "Yarn" / "Cache"),
|
|
68
|
+
("cargo", "Cargo registry cache", home / ".cargo" / "registry" / "cache"),
|
|
69
|
+
("ruff", "Ruff cache", local_app / "ruff"),
|
|
70
|
+
("mypy", "mypy cache", home / ".mypy_cache"),
|
|
71
|
+
("nuget", "NuGet HTTP cache", local_app / "NuGet" / "v3-cache"),
|
|
72
|
+
("gradle", "Gradle cache", home / ".gradle" / "caches"),
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def scan_caches(candidates: list[tuple[str, str, Path]] | None = None) -> list[CacheTarget]:
|
|
77
|
+
"""Scan existing developer cache directories and calculate their sizes."""
|
|
78
|
+
targets: list[CacheTarget] = []
|
|
79
|
+
seen_paths: set[str] = set()
|
|
80
|
+
|
|
81
|
+
for cache_id, name, path in candidates or _candidate_cache_dirs():
|
|
82
|
+
norm = os.path.normcase(os.path.normpath(str(path)))
|
|
83
|
+
if norm in seen_paths or not path.exists() or not path.is_dir():
|
|
84
|
+
continue
|
|
85
|
+
seen_paths.add(norm)
|
|
86
|
+
size = directory_size(path)
|
|
87
|
+
if size > 0:
|
|
88
|
+
targets.append(CacheTarget(id=cache_id, name=name, path=path, size_bytes=size))
|
|
89
|
+
|
|
90
|
+
targets.sort(key=lambda t: t.size_bytes, reverse=True)
|
|
91
|
+
return targets
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def clean_cache_dir(path: Path) -> tuple[int, int]:
|
|
95
|
+
"""Delete contents of a cache directory safely.
|
|
96
|
+
|
|
97
|
+
Returns `(reclaimed_bytes, failed_items)`.
|
|
98
|
+
"""
|
|
99
|
+
if not path.exists() or not path.is_dir():
|
|
100
|
+
return (0, 0)
|
|
101
|
+
|
|
102
|
+
before = directory_size(path)
|
|
103
|
+
failed = 0
|
|
104
|
+
|
|
105
|
+
for child in list(path.iterdir()):
|
|
106
|
+
try:
|
|
107
|
+
if child.is_symlink() or child.is_file():
|
|
108
|
+
child.unlink(missing_ok=True)
|
|
109
|
+
elif child.is_dir():
|
|
110
|
+
shutil.rmtree(child)
|
|
111
|
+
except OSError:
|
|
112
|
+
failed += 1
|
|
113
|
+
|
|
114
|
+
after = directory_size(path)
|
|
115
|
+
reclaimed = max(0, before - after)
|
|
116
|
+
return (reclaimed, failed)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class DevCachesCheck(BaseCheck):
|
|
120
|
+
id = "caches"
|
|
121
|
+
name = "Developer Caches"
|
|
122
|
+
category = "disk"
|
|
123
|
+
description = "Measure reclaimable space in pip, uv, npm, pnpm, cargo, gradle, and ruff caches."
|
|
124
|
+
order = 70
|
|
125
|
+
|
|
126
|
+
def run(self) -> CheckResult:
|
|
127
|
+
caches = scan_caches()
|
|
128
|
+
if not caches:
|
|
129
|
+
return CheckResult(
|
|
130
|
+
check_id=self.id,
|
|
131
|
+
name=self.name,
|
|
132
|
+
category=self.category,
|
|
133
|
+
status=Status.OK,
|
|
134
|
+
summary="No large developer caches found",
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
total = sum(c.size_bytes for c in caches)
|
|
138
|
+
details = [f"{c.name} ({c.id}): {format_bytes(c.size_bytes)} — {c.path}" for c in caches[:6]]
|
|
139
|
+
# Warn if caches exceed 2 GB
|
|
140
|
+
status = Status.WARN if total >= 2 * 1024**3 else Status.INFO
|
|
141
|
+
return CheckResult(
|
|
142
|
+
check_id=self.id,
|
|
143
|
+
name=self.name,
|
|
144
|
+
category=self.category,
|
|
145
|
+
status=status,
|
|
146
|
+
summary=f"{format_bytes(total)} across {len(caches)} cache folder(s)",
|
|
147
|
+
details=details,
|
|
148
|
+
fix_hint="Run `wdd clean --dry-run` to preview or `wdd clean` to reclaim space.",
|
|
149
|
+
)
|