CommandSchema
Runtime descriptor produced by CommandBuilder.
Consumers (parser, help generator, CLI dispatcher) read this to understand the command's shape — flags, args, aliases, subcommands, middleware, and interactive resolver.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/command.ts - Source link:
packages/dreamcli/src/core/schema/command.ts:432
Signatures
interface CommandSchema {}Members
Properties
aliases
Alternative names for this command.
aliases: readonly string[];args
Ordered positional arg entries (name + schema).
args: readonly CommandArgEntry[];commands
Nested subcommand schemas (for help rendering and completion).
Pure data — no execution closures. Populated by .command() on CommandBuilder. Empty for leaf commands.
commands: readonly CommandSchema[];description
Human-readable description for help text.
description: string | undefined;examples
Usage examples for help text.
examples: readonly CommandExample[];flags
Named flag schemas, keyed by flag name.
flags: Readonly<Record<string, FlagSchema>>;hasAction
Whether an action handler has been registered.
hasAction: boolean;hidden
Whether this command is hidden from help listings.
hidden: 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.
interactive: ErasedInteractiveResolver | undefined;middleware
Middleware handlers to run before the action handler.
Executed in registration order — first middleware registered runs first and calls next() to proceed to subsequent middleware, ending with the action handler. Context accumulates via intersection at the type level and via object spread at runtime.
middleware: readonly ErasedMiddlewareHandler[];name
The command name (used for dispatch, e.g. 'deploy').
name: string;