Skip to content

HelpConfig

Consumer-facing root-help configuration set via CLIBuilder.help.

Every field is optional; unset fields fall back to built-in defaults and may be overridden per call through runtime options.help.

Signatures

ts
interface HelpConfig {}

Members

Properties

flagOrder

Order of flags in the Flags: table.

  • 'alphabetical' — short-aliased flags first, then alphabetical by name.
  • 'declaration' — the order .flag() was called.

Ignored when HelpConfig.sortFlags is set.

ts
flagOrder?: "alphabetical" | "declaration";

Show the Run '<bin> <command> --help' for more information. hint.

Defaults to showing the hint only when visible subcommands exist.

ts
footer?: boolean;

Emit OSC 8 hyperlinks in the header when supported.

ts
hyperlinks?: boolean;

inlineDefault

Render the default command's arguments and flags inline at the root.

ts
inlineDefault?: boolean;

showDefaultInCommands

Also list the default command in the root Commands: table.

By default the default command is the root surface and is omitted from the command list (its args/flags render inline instead).

ts
showDefaultInCommands?: boolean;

sortFlags

Custom comparator over flag long names for the Flags: table. When set, it wins over HelpConfig.flagOrder.

ts
sortFlags?: { (a: string, b: string): number; };

theme

Theme overrides for help output, merged over the built-in theme.

The factory receives the gated ansispeck palette (same instance as out.color), so overrides follow the output channel's color policy. It is never invoked when color is off — themed help cannot leak escapes into piped, --json, or NO_COLOR output.

ts
theme?: HelpThemeFactory;

width

Maximum line width (columns).

ts
width?: number;

See Also

Released under the MIT License.