CommandMeta<TCategory> Command metadata for help generation.
generics
TCategory
stringstringschema
z.ZodTypesummary
stringusage
stringcategory
TCategorySchema-driven CLI help generator.
Generalized from the identical pattern in tx and zzz. Consumers configure
once with create_help and get back generate_main_help,
generate_command_help, and get_help_text.
7 declarations
CommandMeta<TCategory> Command metadata for help generation.
TCategorystringstringschemaz.ZodTypesummarystringusagestringcategoryTCategory<TCategory extends string>(options: HelpOptions<TCategory>): HelpGenerator Create a help generator configured for an application.
optionshelp configuration
HelpOptions<TCategory>HelpGenerator help generator with generate_main_help, generate_command_help, and get_help_text
(prop: ZodSchemaProperty): string Format argument name with short aliases for display.
Only single-char aliases are shown (e.g., -h, --help).
Flags use snake_case (e.g., --env_file, --detect_only).
propschema property
ZodSchemaPropertystring formatted name string
HelpCategory<TCategory> Category configuration for help display.
TCategorystringstringkeyTCategorytitlestringHelpGenerator Help generator returned by create_help.
generate_main_helpGenerate main help text with all commands grouped by category.
() => stringgenerate_command_helpGenerate help text for a specific command.
(command: string, meta: CommandMeta) => stringget_help_textGet help text for a command or main help.
(command?: string, subcommand?: string) => stringHelpOptions<TCategory> Configuration for create_help.
TCategorystringstringnameApplication name (e.g., "tx", "zzz").
stringversionApplication version string.
stringdescriptionShort description for the main help header.
stringcommandsCommand registry keyed by command path (e.g., "apply", "daemon start").
Record<string, CommandMeta<TCategory>>categoriesCategory display order for main help.
Array<HelpCategory<TCategory>>examplesExample commands for main help.
Array<string>global_args_schemaZod schema for global arguments (shown in all help output).
z.ZodTypeuse_colorsWhether to use ANSI colors in output. Defaults to true.
boolean<T>(items: T[], to_string: (item: T) => string): number Get maximum length from array.
itemsarray of items
T[]to_stringfunction to convert item to string for length measurement
(item: T) => stringnumber maximum string length