Skip to main content

render_cli_reference

Function render_cli_reference 

Source
pub fn render_cli_reference(cli: &BuiltCliSpec) -> String
Expand description

Render an offline Markdown reference for a whole registry.

help-v2 is deliberately lossy: it answers “how do I call this” one command at a time, in as few tokens as possible. A reference manual wants the opposite, so it is a separate capability rather than a format on the discovery path — the agent’s --help never grows a documentation mode, and the manual can never disagree with the parser, because both are this registry. --docs is injected into every registry, so a tool exposes this without registering a command, and without spending a line of its subcommand listing on something no agent calls.

What is deliberately not repeated: a lone combination’s description and id — the command heading already carries the description, and the id only matters for telling siblings apart. Shared output and argument defaults are stated once at the widest scope at which they apply.