22
33> A cross-platform CLI that detects, diagnoses and helps resolve development environment problems.
44
5- ![ status] ( https://img.shields.io/badge/status-skeleton-lightgrey )
5+ ![ status] ( https://img.shields.io/badge/status-M1_collectors-orange )
66[ ![ license] ( https://img.shields.io/badge/license-MIT-blue )] ( LICENSE )
77![ Go] ( https://img.shields.io/badge/go-1.23-00ADD8?logo=go&logoColor=white )
88
9- ** Status: skeleton (v0.0 .0).** This repository contains the project structure, architecture decisions and
10- an implementation plan . ** Nothing is functional yet. ** The word "works" does not appear below unless it is
11- true .
9+ ** Status: M1 (v0.1 .0).** EnvDoctor collects platform, shell and PATH facts and prints them as text or JSON,
10+ with a documented exit-code contract . ** There are no diagnostic rules yet** , so it cannot tell you that
11+ anything is wrong: ` diagnose ` lists facts and then reports zero findings. Nothing is modified on your machine .
1212
1313## Why this exists
1414
@@ -22,17 +22,17 @@ explains the cause instead of dumping raw output.
2222| Capability | Milestone | Status |
2323| ---| ---| ---|
2424| Detect conflicting Python and Node versions | M2 | Not started |
25- | Identify broken PATH entries | M2 | Not started |
25+ | Identify broken PATH entries | M2 | Facts reported; no rule yet |
2626| Detect port conflicts | M2 | Not started |
2727| Diagnose Docker daemon problems | M3 | Not started |
2828| Identify missing system dependencies | M3 | Not started |
2929| Detect incompatible package managers | M3 | Not started |
3030| Check Git configuration | M2 | Not started |
3131| Generate diagnostic bundles | M4 | Not started |
32- | Human-readable reports | M4 | Not started |
33- | JSON export | M4 | Not started |
32+ | Human-readable reports | M4 | Basic text report (M1); polish is M4 |
33+ | JSON export | M1 | ** Done ** |
3434| Safe, opt-in automated remediation | M5 | Not started |
35- | Windows, Linux and macOS support | M6 | Not started |
35+ | Windows, Linux and macOS support | M6 | Collectors build for all three; CI matrix not yet run |
3636
3737## Architecture
3838
@@ -64,38 +64,86 @@ might not exist, and no fix may run without explicit confirmation.
6464
6565## Quickstart
6666
67- Not runnable yet. The skeleton builds and prints its version:
67+ Requires Go 1.23+.
6868
6969``` bash
7070make build
71- ./bin/envdoctor version
71+ ./bin/envdoctor diagnose
7272```
7373
74- Full local stack (build and test tooling) arrives with
75- milestone M1.
74+ ```
75+ EnvDoctor 0.1.0 - environment diagnosis
76+ Generated 2026-11-13T01:41:49Z
77+
78+ Platform windows 11 (build 26300) amd64
79+ Elevated no
80+ Shell powershell
81+ PATH 26 entries, 2 missing, 0 duplicate
82+
83+ Missing PATH entries:
84+ - C:\Windows\System32
85+ - ~\AppData\Local\Programs\Antigravity\bin
86+
87+ Rules 0 registered in this build
88+
89+ No findings.
90+ ```
91+
92+ That output is real, captured from ` goreleaser build --snapshot ` on Windows 11 while developing M1. The
93+ leading space in the first entry is part of the value: it is a malformed PATH element, and that is exactly
94+ what the collector is for.
95+
96+ Machine-readable output, for an editor or CI:
97+
98+ ``` bash
99+ ./bin/envdoctor diagnose --json
100+ ```
101+
102+ The JSON document is validated against [ docs/schema/diagnose-v1.schema.json] ( docs/schema/diagnose-v1.schema.json )
103+ in the test suite; the snapshot inside it is described by
104+ [ docs/schema/snapshot-v1.schema.json] ( docs/schema/snapshot-v1.schema.json ) . Home directories are replaced
105+ with ` ~ ` before anything is written.
106+
107+ Exit codes: ` 0 ` nothing at or above warning, ` 1 ` warnings, ` 2 ` at least one error, ` 3 ` the tool itself failed
108+ (including a collector timeout), ` 4 ` invalid usage. Today only ` 0 ` , ` 3 ` and ` 4 ` are reachable, because zero
109+ rules are registered.
110+
111+ ` --component ` and ` --rule ` narrow which rules are evaluated. With no rules, either flag can only produce an
112+ empty result or an "unknown rule" error.
113+
114+ A local release build of all six targets:
115+
116+ ``` bash
117+ goreleaser build --snapshot --clean
118+ ```
119+
120+ ` goreleaser check ` additionally wants a git remote, so it only passes once the repository is pushed.
76121
77122## Repository layout
78123
79124| Path | Purpose |
80125| ---| ---|
81126| ` cmd/envdoctor ` | CLI entry point |
82- | ` internal/collector ` | Collector interface and registry |
83- | ` internal/collector/{windows,linux,darwin} ` | Platform-specific collectors behind build tags |
84- | ` internal/diagnostic ` | Rule engine, severity model, explanation composition |
85- | ` internal/report ` | Terminal renderer, JSON renderer, bundle writer |
86- | ` internal/fix ` | Remediation plans, dry-run by default |
127+ | ` internal/cli ` | Command wiring, flags, exit codes |
128+ | ` internal/config ` | Resolved options, schema version, collector timeout |
129+ | ` internal/collector ` | Collector interface, registry, parallel runner |
130+ | ` internal/collector/{windows,linux,darwin} ` | Reserved for build-tagged collectors (empty in M1) |
131+ | ` internal/diagnostic ` | Rule engine, severity model, fixture harness |
132+ | ` internal/report ` | Terminal renderer, JSON renderer |
133+ | ` internal/fix ` | Remediation plans, dry-run by default (empty until M5) |
87134| ` internal/system ` | Thin wrappers over OS facilities, the only place syscalls live |
135+ | ` docs/schema ` | Committed JSON schemas, enforced by tests |
88136| ` tests/golden ` | Snapshot-to-diagnosis fixtures, one per rule |
89137| ` deploy ` | Release and packaging notes |
90138
91139## Roadmap
92140
93141| Milestone | Deliverable | Status |
94142| ---| ---| ---|
95- | M1 | CLI foundation, collector interface, system information | Not started |
143+ | M1 | CLI foundation, collector interface, system information | ** Done ** (v0.1.0) |
96144| M2 | Cross-platform collectors: runtimes, PATH, ports, Git | Not started |
97- | M3 | Diagnostic rule engine and Docker/ dependency rules | Not started |
98- | M4 | Human-readable reports, JSON export, diagnostic bundles | Not started |
145+ | M3 | Rules ENV007–ENV012, Docker and dependency inspectors, ` explain ` | Not started |
146+ | M4 | Polished terminal output, Markdown export, diagnostic bundles | Not started |
99147| M5 | Safe, confirmed automated remediation | Not started |
100148| M6 | Windows, Linux, macOS packaging and signed releases | Not started |
101149
0 commit comments