22
33> A cross-platform CLI that detects, diagnoses and helps resolve development environment problems.
44
5- ![ status] ( https://img.shields.io/badge/status-M3_complete -green )
5+ ![ status] ( https://img.shields.io/badge/status-M4_verified -green )
66[ ![ license] ( https://img.shields.io/badge/license-MIT-blue )] ( LICENSE )
77![ Go] ( https://img.shields.io/badge/go-1.26-00ADD8?logo=go&logoColor=white )
88
9- ** Status: M3 complete on ` feat/m3-implementation ` ; Windows, Ubuntu and macOS CI passed.**
9+ ** Status: M1–M3 merged; M4 implemented and verified on ` feat/m4-implementation ` .**
10+ Native Windows/Ubuntu/macOS race, tests and builds, lint and the vulnerability scan passed in
11+ [ M4 CI] ( https://github.com/Shellghostt/EnvDoctor/actions/runs/44421272870 ) .
12+ [ PR #4 ] ( https://github.com/Shellghostt/EnvDoctor/pull/4 ) is open for review.
1013Nine collectors feed twelve rules covering platform, shell, PATH, Python/Node runtime, requested TCP ports,
1114effective Git config, local Docker/API metadata, explicit project dependencies and proxy configuration.
12- Reports are plain text or versioned JSON; ` explain ` and ` rules --json ` work offline.
15+ Reports support a scrolling terminal viewer, plain text, Markdown and versioned JSON.
16+ Redacted diagnostic bundles can be evaluated offline; ` explain ` and ` rules --json ` also work offline.
1317Diagnosis never applies fixes or executes interpreters found on PATH. The
14- [ M3 validation record] ( docs/testing/m3-validation.md ) records commands, live checks and limits.
18+ [ M4 validation record] ( docs/testing/m4-validation.md ) records commands, live checks and limits;
19+ [ M3 validation] ( docs/testing/m3-validation.md ) preserves the merged baseline evidence.
1520
1621## Why this exists
1722
@@ -35,8 +40,8 @@ explains the cause instead of dumping raw output.
3540| Detect virtualenv/interpreter mismatch | M3 | ** Implemented** , known canonical environment metadata |
3641| Inspect proxy configuration and optional reachability | M3 | ** Implemented** , redacted and offline by default |
3742| Explain rules and export the rule registry | M3 | ** Implemented** , no collectors invoked |
38- | Generate diagnostic bundles | M4 | Not started |
39- | Human-readable reports | M2/M4 | ** Done ** plain text; interactive polish is M4 |
43+ | Generate redacted diagnostic bundles and evaluate them offline | M4 | ** Implemented and verified ** locally and in native CI |
44+ | Human-readable reports | M2/M4 | Plain text, scrolling terminal viewer and escaped Markdown |
4045| JSON export | M1 | ** Done** |
4146| Safe, opt-in automated remediation | M5 | Not started |
4247| Windows, Linux and macOS support | M2/M6 | Three-OS code and fixtures; signed release/clean-host verification is M6 |
@@ -49,7 +54,10 @@ flowchart TD
4954 COL --> SNAP[Typed snapshot and redaction]
5055 SNAP --> ENGINE[Pure diagnostic engine]
5156 REG[Rule registry] --> ENGINE
52- ENGINE --> REPORT[Plain text or JSON with manual advice]
57+ ENGINE --> REPORT[Terminal, text, Markdown or JSON report]
58+ SNAP --> BUNDLE[Allowlisted sharing evidence and bounded ZIP]
59+ BUNDLE --> OFFLINE[Validated captured evidence]
60+ OFFLINE --> ENGINE
5361 META[explain and rules] --> REG
5462 REG --> PAGES[Generated rule pages]
5563```
@@ -110,6 +118,51 @@ in the test suite; the snapshot inside it is described by
110118[ docs/schema/snapshot-v1.schema.json] ( docs/schema/snapshot-v1.schema.json ) . Home directories are replaced
111119with ` ~ ` , and credential-bearing URLs are redacted before anything is written.
112120
121+ ## Terminal reports and sharing bundles
122+
123+ The default report opens a scrolling viewer when stdin, stdout and stderr are terminals. Use arrows,
124+ Page Up/Page Down and ` q ` ; quitting retains the diagnosis exit code and leaves a plain report behind.
125+ Interrupts and rendering failures exit 3 and restore terminal state. Redirects, ` TERM=dumb ` , ` NO_COLOR `
126+ (including an empty value), ` --plain ` and explicit text select plain output.
127+
128+ ![ EnvDoctor M4 terminal viewer] ( docs/images/m4-terminal.jpg )
129+
130+ This is real Windows PTY output from the implemented CLI, displayed in xterm.js with the committed
131+ synthetic [ viewer fixture] ( docs/testing/fixtures/m4-viewer/snapshot.json ) . Its identities and paths are
132+ examples. The browser display is a captured terminal preview; native console restoration and resize
133+ were checked separately.
134+
135+ ``` powershell
136+ .\bin\envdoctor.exe diagnose --plain
137+ .\bin\envdoctor.exe diagnose --format markdown > diagnosis.md
138+ .\bin\envdoctor.exe diagnose --format json > diagnosis.json
139+ .\bin\envdoctor.exe bundle --output envdoctor-bundle.zip --include-logs
140+ .\bin\envdoctor.exe diagnose --from-bundle envdoctor-bundle.zip --json
141+ ```
142+
143+ JSON and Markdown bypass the viewer. ` --json ` remains an alias for ` --format json ` ; conflicting formats
144+ or ` --plain ` with JSON/Markdown exit 4 before collection. Markdown includes evidence, manual suggestions,
145+ verification, limitations, degraded collectors and skipped prerequisites, with dynamic markup escaped.
146+
147+ Bundle export uses a separate typed allowlist: Git identity becomes presence booleans, paths and hosts
148+ become deterministic capture-local aliases, and unsupported required evidence is explicitly omitted and
149+ degraded. Raw environment values, identities, project contents and free-text logs/errors are excluded.
150+ ` --include-logs ` adds only structured collector statuses and bounded timings. Numeric versions, ports and
151+ diagnostic facts still describe the captured setup; review the bundle before sharing it.
152+
153+ The ZIP is below 2,000,000 bytes, with independent member, decompression and JSON-work bounds. Publication
154+ stages a private file and replaces the destination atomically after validation. The bounded ` Writing... `
155+ status precedes replacement; exit 0 confirms publication, including captures with findings or degradation.
156+ Usage exits 4; capture, archive, cancellation, output and file failures exit 3.
157+
158+ ` --from-bundle ` validates evidence and evaluates the current builtin rules without collectors or network
159+ work. It preserves capture provenance and omissions; saved verdicts and commands remain reference data.
160+ It conflicts with ` --fixture-dir ` , ` --port ` , ` --probe-network ` and ` --package-manager ` . Valid offline
161+ diagnosis retains exits 0/1/2/3, including 3 for unavailable required evidence. Ordinary JSON keeps its
162+ existing fields and Git identity; bundle-source metadata is an optional addition used by offline reports.
163+ Read [ ADR 0006] ( docs/adr/0006-m4-reports-and-bundles.md ) and the
164+ [ sharing schemas] ( docs/schema/bundle-snapshot-v1.schema.json ) for the exact policy and limits.
165+
113166Exit codes: ` 0 ` nothing at or above warning, ` 1 ` warnings, ` 2 ` at least one error, ` 3 ` the tool itself failed
114167(including a collector timeout), ` 4 ` invalid usage. Captured collector errors retain exit 3 during offline
115168diagnosis. A degraded report still contains the findings that could be evaluated.
@@ -188,7 +241,7 @@ Different Docker product versions alone do not establish API incompatibility. Wi
188241opaque shims and protected package paths remain unresolved metadata.
189242
190243Home paths and credential-bearing URLs are redacted, including error notices. JSON includes Git identity;
191- review it before sharing. Diagnostic bundles with broader redaction remain M4 .
244+ review it before sharing. Use the M4 bundle command for the separate allowlisted sharing representation .
192245
193246## Testing
194247
@@ -206,8 +259,10 @@ The suite includes 172 exact golden cases, preserving all 54 original M2 snapsho
206259It builds the CLI and checks those cases through real subprocesses, validating JSON and exit codes.
207260Native Windows and Linux race suites passed locally. The native Windows, Ubuntu and macOS race/test/build
208261matrix, lint and vulnerability scan passed in [ M3 CI] ( https://github.com/Shellghostt/EnvDoctor/actions/runs/43723839978 ) .
209- Both macOS architectures also cross-build. Commands, allocation measurements,
210- socket lifecycle evidence and limits are in [ docs/testing/m3-validation.md] ( docs/testing/m3-validation.md ) .
262+ M4 passes local Windows/Linux race, all canonical targets, bounded fuzzing, archive/privacy tests and
263+ all six static build targets. Native Windows/Ubuntu/macOS M4 CI also passed. Commands, terminal evidence,
264+ allocation measurements and limits are in [ M4 validation] ( docs/testing/m4-validation.md ) ;
265+ [ M3 validation] ( docs/testing/m3-validation.md ) records the earlier socket and CI evidence.
211266
212267` make docs ` regenerates all twelve rule pages from the same registry as findings, ` explain ` and ` rules ` .
213268` make check-docs ` and CI detect documentation drift. Do not edit generated pages directly.
@@ -218,7 +273,8 @@ A local release build of all six targets:
218273goreleaser build --snapshot --clean
219274```
220275
221- ` goreleaser check ` and the local six-target snapshot build passed. A snapshot build does not publish a release.
276+ M3 validation records the passing GoReleaser check and six-target snapshot build. M4 verifies static
277+ builds separately; packaging, signed releases and clean-host checks remain M6.
222278
223279## Repository layout
224280
@@ -230,9 +286,10 @@ goreleaser build --snapshot --clean
230286| ` internal/config ` | Resolved options, schema version, collector timeout |
231287| ` internal/collector ` | Parallel runner and nine collectors, including project and proxy evidence |
232288| ` internal/diagnostic ` | Rule registry, pure engine, severity model, fixture harness |
233- | ` internal/report ` | Terminal renderer, JSON renderer |
289+ | ` internal/report ` | Terminal lifecycle, plain text, Markdown and JSON renderers |
290+ | ` internal/bundle ` | Allowlisted export, strict bounded reader and atomic publication |
234291| ` internal/fix ` | Remediation plans, dry-run by default (empty until M5) |
235- | ` internal/system ` | Thin wrappers over OS facilities, the only place syscalls live |
292+ | ` internal/system ` | Machine-inspection wrappers; bundle file I/O and terminal control have separate boundaries |
236293| ` docs/schema ` | Committed JSON schemas, enforced by tests |
237294| ` tests/golden ` | 172 snapshot-to-diagnosis fixtures |
238295| ` tests/integration ` | Built CLI tests against all golden cases |
@@ -241,16 +298,21 @@ goreleaser build --snapshot --clean
241298
242299## Roadmap
243300
244- M3 is ** complete on the feature branch, including three-OS CI** . Read the
301+ M3 is ** complete and merged** through [ PR #3 ] ( https://github.com/Shellghostt/EnvDoctor/pull/3 ) , with
302+ successful [ main CI] ( https://github.com/Shellghostt/EnvDoctor/actions/runs/43802280915 ) . Read the
245303[ M3 acceptance gates] ( docs/phases/M3.md ) , [ accepted ADR 0005] ( docs/adr/0005-m3-evidence-and-rule-registry.md )
246304and [ validation record] ( docs/testing/m3-validation.md ) for its contracts and evidence.
305+ M4 ENV-024–ENV-026 are implemented and verified under the
306+ [ M4 requirements] ( docs/phases/M4.md ) and [ accepted ADR 0006] ( docs/adr/0006-m4-reports-and-bundles.md ) .
307+ [ Validation] ( docs/testing/m4-validation.md ) records local evidence and passing native GitHub CI;
308+ [ PR #4 ] ( https://github.com/Shellghostt/EnvDoctor/pull/4 ) is open for review.
247309
248310| Milestone | Deliverable | Status |
249311| ---| ---| ---|
250312| M1 | CLI foundation, collector interface, system information | ** Done** (v0.1.0) |
251313| M2 | Cross-platform collectors and rules ENV001–ENV006 | ** Done (merged)** |
252- | M3 | Rules ENV007–ENV012, Docker/dependency/proxy evidence, offline registry commands | ** Done (feature branch, CI passed )** |
253- | M4 | Polished terminal output , Markdown export, diagnostic bundles | Not started |
314+ | M3 | Rules ENV007–ENV012, Docker/dependency/proxy evidence, offline registry commands | ** Done (merged )** |
315+ | M4 | Terminal viewer , Markdown, redacted bundles and offline diagnosis | Verified; [ PR # 4 ] ( https://github.com/Shellghostt/EnvDoctor/pull/4 ) open |
254316| M5 | Safe, confirmed automated remediation | Not started |
255317| M6 | Windows, Linux, macOS packaging and signed releases | Not started |
256318
0 commit comments