@clibu/help
v0.1.0
Published
Help text renderer for Clibu
Readme
@clibu/help
Deterministic text help renderer for Clibu. Produces aligned root and per‑command views; filters global options appropriately and annotates metadata.
Features
- Root and per‑command help output (with SUBCOMMANDS when present).
- GLOBAL OPTIONS section (filtered when overridden or
inheritGlobal: false). - Aligned columns and concise metadata tags:
[required],[default: X],[choices: a|b|c]. - Small, snapshot‑friendly output (stable across environments).
Basic usage
import type { CLIConfig } from "@clibu/core"
import { renderHelp, renderCommandHelp } from "@clibu/help"
function showHelp(cfg: CLIConfig, path: string[] = []) {
const out = path.length ? renderCommandHelp(cfg, path) : renderHelp(cfg)
console.log(out)
}API surface
renderHelp(cfg: CLIConfig): stringrenderCommandHelp(cfg: CLIConfig, path: string[]): string
Status
- Used by the
clibufacade to render--help/-h. - When testing
@clibu/core, an internal fallback renderer is used to avoid cross‑package coupling.
License
MIT © KazViz
