Skip to content

CommandSchema ​

Runtime descriptor produced by CommandBuilder.

Consumers (parser, help generator, CLI dispatcher) read this to understand the command's shape — flags, args, aliases, subcommands, and interactive resolver.

Signatures ​

ts
interface CommandSchema {}

Members ​

Properties ​

schemaBrand ​

Type-only seal produced by createCommandSchema.

ts
schemaBrand: "command";

name ​

The command name (used for dispatch, e.g. 'deploy').

ts
name: string;

description ​

Human-readable description for help text.

ts
description: string | undefined;

details ​

Longer explanation shown only in this command's help, with paragraphs wrapped to its width.

ts
details?: HelpDescription | undefined;

aliases ​

Alternative names for this command.

ts
aliases: readonly string[];

hidden ​

Whether this command is hidden from help listings.

ts
hidden: boolean;

examples ​

Usage examples for help text.

ts
examples: readonly CommandExample[];

flags ​

Named flag schemas, keyed by flag name.

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

flagDeclarationOrder ​

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

ts
flagDeclarationOrder?: readonly string[] | undefined;

helpTopics ​

Text-help topic names mapped to flag group names.

ts
helpTopics?: Readonly<Record<string, string>> | undefined;

args ​

Ordered positional arg entries (name + schema).

ts
args: readonly CommandArgEntry[];

constraints ​

Relationships checked after input resolution.

ts
constraints?: readonly CommandConstraint[] | undefined;

validators ​

Object validators run after resolution. @internal

ts
validators?: readonly CommandValidator[] | undefined;

hasAction ​

Whether an action handler has been registered.

ts
hasAction: boolean;

interactive ​

Command-level interactive resolver for schema-driven prompt control.

When set, called after CLI/env/config resolution with partially resolved flag values. Returns prompt configs for flags that need interactive input. Takes precedence over per-flag .prompt() configs for flags it returns configs for; flags not mentioned fall back to their per-flag configs.

ts
interactive: ErasedInteractiveResolver | undefined;

commands ​

Nested subcommand schemas (for help rendering and completion).

Pure data — no execution closures. Populated by .command() on CommandBuilder. Empty for leaf commands.

ts
commands: readonly CommandSchema[];

See Also ​

Released under the MIT License.