src/cli.ts:33 advertises --format <format> as json, table, csv, ndjson, and README.md:203 repeats it. In practice jsonOutput() (src/lib/output.ts:9-21) ignores opts.format entirely and always emits JSON.
The global flag is read in exactly one place — src/commands/doctor.ts:178. formatTable (src/lib/output.ts:40-53) is implemented and unit-tested but is called nowhere in src/. formatCsv is reachable only via the local +export --format csv flag (src/helpers/export.ts:74-76). NDJSON appears only in the help string; +watch hand-writes NDJSON lines (src/helpers/watch.ts:62,73) but is not driven by --format.
So of four advertised formats, one is implemented. The CLI ships a false --help contract.
Fix
- Dispatch the three formats through
jsonOutput() — formatTable and formatCsv already exist and work, they just need calling — or remove them from --help and README.md.
- Add an argv-level test asserting each advertised
--format value actually changes stdout. The absence of one is why this shipped: tests/output.test.js:46-66 tests the formatters in isolation, never through the CLI.
Note
--no-color (src/cli.ts:39) is also declared and never read. Since nothing in the codebase emits color (no chalk, no ANSI escapes, no NO_COLOR handling), it is a redundant no-op rather than a broken promise — lower stakes, but worth resolving in the same pass.
src/cli.ts:33advertises--format <format>asjson, table, csv, ndjson, andREADME.md:203repeats it. In practicejsonOutput()(src/lib/output.ts:9-21) ignoresopts.formatentirely and always emits JSON.The global flag is read in exactly one place —
src/commands/doctor.ts:178.formatTable(src/lib/output.ts:40-53) is implemented and unit-tested but is called nowhere insrc/.formatCsvis reachable only via the local+export --format csvflag (src/helpers/export.ts:74-76). NDJSON appears only in the help string;+watchhand-writes NDJSON lines (src/helpers/watch.ts:62,73) but is not driven by--format.So of four advertised formats, one is implemented. The CLI ships a false
--helpcontract.Fix
jsonOutput()—formatTableandformatCsvalready exist and work, they just need calling — or remove them from--helpandREADME.md.--formatvalue actually changes stdout. The absence of one is why this shipped:tests/output.test.js:46-66tests the formatters in isolation, never through the CLI.Note
--no-color(src/cli.ts:39) is also declared and never read. Since nothing in the codebase emits color (nochalk, no ANSI escapes, noNO_COLORhandling), it is a redundant no-op rather than a broken promise — lower stakes, but worth resolving in the same pass.