Skip to content

CommandDefinitionDocumentV1 ​

A single-command definition document, version 1.

Produced by generateCommandSchema. Same shape as a CommandDefinitionFragmentV1 plus the schemaVersion every standalone document carries.

Signatures ​

ts
type CommandDefinitionDocumentV1 = CommandDefinitionFragmentV1 & { schemaVersion: 1; envPrefix?: string; groupOrder?: readonly string[]; };

Members ​

Members ​

name ​

The command name used for dispatch.

ts
name: string;

description ​

Human-readable description for help text.

ts
description?: string;

details ​

Longer explanation shown only in this command's help.

ts
details?: string;

aliases ​

Alternative names accepted for this command.

ts
aliases?: readonly string[];

hidden ​

Whether the command is omitted from help listings.

ts
hidden?: true;

examples ​

Usage examples attached to the command.

ts
examples?: readonly ExampleDefinitionFragmentV1[];

flags ​

Named flag definitions keyed by flag name.

ts
flags: Readonly<Record<string, FlagDefinitionFragmentV1>>;

flagDeclarationOrder ​

Flag declaration order when it differs from the flag record's key order.

ts
flagDeclarationOrder?: readonly string[];

args ​

Positional argument definitions in CLI order.

ts
args: readonly ArgDefinitionFragmentV1[];

constraints ​

Declarative relationships between the command's inputs.

ts
constraints?: readonly CommandConstraint[];

commands ​

Nested subcommand definitions.

ts
commands: readonly CommandDefinitionFragmentV1[];

schemaVersion ​

Definition document format version.

ts
schemaVersion: 1;

envPrefix ​

CLI-wide env namespace the command runs under, read the same way as DefinitionDocumentV1.envPrefix.

ts
envPrefix?: string;

groupOrder ​

Named help groups to display first, in order, for this command.

ts
groupOrder?: readonly string[];

See Also ​

Released under the MIT License.