Repository navigation
CLI: Label the tools help Output block as the --json shape - #36089
Conversation
The help's `Output:` block is generated from a method's declared output schema, so it documents `data` — what `--json` prints — while stdout defaults to the rendered markdown. Nothing said so, so a tool whose two renderings differ widely (stories preview: three fields vs one bare URL) read as broken. The heading now names the flag, which is what carries the qualification into the per-method view where no notes block exists. The root help gains one line pointing at those blocks. The `renderToolsHelp` docblock no longer claims the Options block is the flags' only documentation. Closes #36087
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe tools CLI help now identifies output schemas as the data returned by ChangesTools CLI help output clarification
Merge Risk: ⚪ Minimal · up to This change clarifies that the documented Output shape is returned by ✨ Finishing Touches📝 Generate docstrings
Comment |
Closes #36087
What I did
storybook tools stories preview --helpdocuments an output the command doesn't print.What you run:
What its help promised:
Three fields documented, one bare URL delivered. It reads as a broken tool.
It isn't. Every tool produces two renderings of one run: markdown for stdout, structured
datafor--json. TheOutput:block is generated from the output schema, so it has always described the--jsonhalf — it just never said so.The fix
The heading now names the flag:
One line in
methodBodyLines, which all three help views compose, so the root reference, the per-toolset view and the per-method view are covered at once.It has to be the heading rather than a footnote somewhere:
--helpon a single tool prints no notes block, and that is the view you reach for right after a surprising result.Two smaller things:
Tool results print as markdown; the Output blocks below describe the --json data.renderToolsHelpdocblock claimed the Options block is the flags' only documentation. The notes block documents flag behaviour too, so that stopped being true.What I left alone
formatPreviewStoriesstill emits a bare URL per story. Over MCP,titleandnamealready travel instructuredContentnext to the text blocks, so repeating them in the markdown would duplicate what the structured half exists to carry.Why this surfaced now: the two-rendering split is a straight port from the standalone MCP repo, which shipped no CLI. Over MCP both halves always arrive in the same reply, so the mismatch was invisible.
storybook toolsis the first surface that shows one and puts the other behind a flag.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
help.test.tsasserts all three renderings as full inline snapshots, so the new wording is readable straight from the diff.run.test.tscovers the run-level path to the help dump. No new test seam was needed.Manual testing
Build once, then run each command from
code/:node core/dist/bin/dispatcher.js tools stories preview --help— the schema block is headedOutput (`--json`):node core/dist/bin/dispatcher.js tools --help— the notes block underCommands:carries the new markdown/--jsonlinenode core/dist/bin/dispatcher.js tools docs list --help— a tool with no output schema still prints noOutputsection at allstories previewfor real: stdout is a bare URL, and--jsonreturns the shape the help documentsDocumentation
The changed text is itself the documentation — the tools help is generated at runtime and has no separate docs page.