Skip to content

--format table|csv|ndjson is advertised but never implemented #94

Description

@KalebCole

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions