formatHelp
Generated reference page for the formatHelp function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/help/index.ts - Source link:
packages/dreamcli/src/core/help/index.ts:379
Signatures
ts
function formatHelp(schema: CommandSchema, options?: HelpOptions): string;| Parameter | Type | Description |
|---|---|---|
schema | CommandSchema | The command schema to render help for. |
options | HelpOptions | undefined | Formatting options (width, binary name). |
Members
Members
formatHelp
Generate help text from a command schema.
Low-level formatter: most applications reach this through --help, help <command>, or root help rendering in CLIBuilder. Call formatHelp() directly when embedding DreamCLI help text into custom UIs, tests, or generated docs.
Sections rendered (in order):
- Usage line —
program <command> [flags] <args> - Description — the command's
.description()text - Commands — subcommands table (if any, skips hidden)
- Arguments — positional args table (if any)
- Flags — flags table with type hints and defaults
- Examples — usage examples (if any)
ts
(schema: CommandSchema, options?: HelpOptions): string;Examples
ts
const text = formatHelp(deploy.schema, { binName: 'mycli' });