Add first version of dev sandbox

This commit is contained in:
Alex Selimov 2026-05-13 20:51:24 -04:00
parent 883b0df070
commit 7974e725d0
10 changed files with 989 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# Plan: Add `--json` output mode to the `report` CLI
Add a `--json` flag to the existing `report` command so it can emit machine-readable output in addition to the current human-readable table. Must not change default behavior.
## Tasks
- [x] 1. Read `src/cli/report.ts` and identify where output is currently rendered.
- [x] 2. Define a `ReportJson` type in `src/cli/report-types.ts` matching the existing table columns.
- [~] 3. Add `--json` flag parsing to `src/cli/report.ts` and thread it through to the renderer.
- [x] 3a. Register the flag with the arg parser.
- [ ] 3b. Branch on the flag in `renderReport()` to call a new `renderJson()` helper.
- [ ] 4. Implement `renderJson()` that prints `JSON.stringify(data, null, 2)` and exits 0.
- [ ] 5. Update `--help` text and `README.md` usage section to document `--json`.
- [ ] 6. Add a test in `test/cli/report.test.ts` covering `--json` output shape.
## Notes
- Keep default (non-`--json`) output byte-identical to current behavior — existing snapshot tests must still pass.
- Open question: should errors also be JSON when `--json` is set? Assuming yes; will confirm with user before step 4.