Summary
Toolcraft's generated --output control is hard-coded to rich, md/markdown, and json. Applications cannot register an additional renderer name such as compact even when the command already has a suitable renderer.
Reproduction
await runCLI(root, { controls: { output: true } });
my-cli query --output compact
# Invalid value for --output. Expected rich, md, markdown, or json.
There is no controls.output.formats / renderer registry hook to accept compact and dispatch it to an application renderer.
Requested change
- Let applications register named output formats and renderer callbacks.
- Include registered names in generated help, validation, completion, and error suggestions.
- Preserve the built-in
rich, md, and json formats.
- Expose the selected output format to command renderers without requiring an application parameter.
- Add an in-process test harness assertion for exact stdout bytes from custom formats.
Downstream impact
homey-sync query commands need a token-minimal TSV/JSONL mode selected as --output compact. The current workaround rewrites argv before runCLI, maps compact to the Markdown transport, injects hidden command parameters, and returns exact text through each Markdown renderer. This is covered by CLI integration tests, but it duplicates routing logic that belongs in Toolcraft and makes custom formats unavailable to other generated surfaces.
Summary
Toolcraft's generated
--outputcontrol is hard-coded torich,md/markdown, andjson. Applications cannot register an additional renderer name such ascompacteven when the command already has a suitable renderer.Reproduction
my-cli query --output compact # Invalid value for --output. Expected rich, md, markdown, or json.There is no
controls.output.formats/ renderer registry hook to acceptcompactand dispatch it to an application renderer.Requested change
rich,md, andjsonformats.Downstream impact
homey-syncquery commands need a token-minimal TSV/JSONL mode selected as--output compact. The current workaround rewrites argv beforerunCLI, mapscompactto the Markdown transport, injects hidden command parameters, and returns exact text through each Markdown renderer. This is covered by CLI integration tests, but it duplicates routing logic that belongs in Toolcraft and makes custom formats unavailable to other generated surfaces.