Skip to content

HelpOptions

Options for customising help output.

Signatures

ts
interface HelpOptions {}

Members

Properties

binName

Binary/program name shown in the usage line. Defaults to command name.

ts
binName?: string;

colors

Gated ANSI palette used to style help output. Identity formatters mean plain text. CLIBuilder.execute()/.run() thread the output channel's out.color here automatically, so styling follows the same policy as handler output (TTY + color support, no --json, NO_COLOR honored).

ts
colors?: Colors;

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 HelpOptions.sortFlags is set.

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

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

Defaults to showing the hint only when visible subcommands exist; set explicitly to force it on or off.

ts
footer?: boolean;

Emit OSC 8 hyperlinks where link metadata is available (currently the root-help header name/version configured via CLIBuilder.links()). Defaults to false; CLIBuilder.execute()/.run() enable it automatically when stdout is a TTY.

ts
hyperlinks?: boolean;

inlineDefault

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

Only affects root-level help. When false, root help lists commands and defers default-command details to <bin> --help-style hints.

ts
inlineDefault?: boolean;

isDefaultHelp

Whether this usage line is being rendered as merged root/default help.

ts
isDefaultHelp?: boolean;

showDefaultInCommands

List the default command in the root Commands: table.

By default the default command is treated as the root surface and 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 HelpOptions.flagOrder.

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

theme

Theme overrides merged over the built-in help theme. Receives the gated palette; never invoked when color is off, so overrides cannot leak escapes into piped output.

ts
theme?: HelpThemeFactory;

version

Program version passed to function-form examples as meta.version.

ts
version?: string;

width

Maximum line width (columns). Defaults to 80.

ts
width?: number;

See Also

Released under the MIT License.