Skip to content

CLIDefinition ​

Input shape accepted by createCLISchema.

Every field except name is optional. Commands accept either definitions or already-built schemas. Plugins are execution state and have no definition field.

Signatures ​

ts
interface CLIDefinition {}

Members ​

Properties ​

name ​

Program name used in help text, usage lines, and completion scripts.

ts
name: string;

inheritName ​

Whether .run() should replace name with the invoked program name.

ts
inheritName?: boolean | undefined;

version ​

Program version shown by --version.

ts
version?: string | undefined;

versionAlias ​

Short version alias without its leading dash.

ts
versionAlias?: string | undefined;

description ​

Program description shown in root help.

ts
description?: string | undefined;

defaultCommandRouted ​

Whether the default command is also exposed as a named top-level route.

ts
defaultCommandRouted?: boolean | undefined;

configSettings ​

Config discovery settings, as a definition or an already-built value.

ts
configSettings?: ConfigSettingsDefinition | ConfigSettings | undefined;

packageJsonSettings ​

Manifest auto-discovery settings.

ts
packageJsonSettings?: ResolvedManifestSettings | undefined;

OSC 8 hyperlink targets for the root-help header.

ts
helpLinks?: HelpLinks | undefined;

hasBuiltInCompletions ​

Whether built-in .completions() registration is active.

ts
hasBuiltInCompletions?: boolean | undefined;

completionsFlag ​

Eager --completions <shell> flag configuration.

ts
completionsFlag?: CompletionsFlagConfig | undefined;

helpConfig ​

Consumer-configured root-help defaults.

ts
helpConfig?: HelpConfig | undefined;

flagSettings ​

Flag-parsing behavior settings.

ts
flagSettings?: ParseOptions | undefined;

builtins ​

Which built-in flags the root keeps.

ts
builtins?: BuiltinsConfig | undefined;

envPrefix ​

CLI-wide environment namespace for relative env bindings, used verbatim ('ACME_' turns TOKEN into ACME_TOKEN).

ts
envPrefix?: string | undefined;

commands ​

Registered command definitions or built schemas, in registration order.

ts
commands?: readonly (CommandDefinition | CommandSchema)[] | undefined;

defaultCommand ​

Default command dispatched when no subcommand matches.

ts
defaultCommand?: CommandDefinition | CommandSchema | undefined;

See Also ​

Released under the MIT License.