import { type ParseArgsOptionsConfig } from "node:util"; import type { z } from "zod"; export interface Command { aliases?: readonly string[]; defaultSubcommand?: Command; description: string; execute?: (rawArgs: readonly string[]) => Promise; groups?: readonly { commands: readonly Command[]; heading: string; }[]; hidden?: boolean; name: string; negativeOptionDescriptions?: Readonly>; optionDescriptions?: Readonly>; options?: ParseArgsOptionsConfig; positionals?: readonly { description?: string; name: string; required?: boolean; }[]; requiredOptions?: readonly string[]; subcommands?: readonly Command[]; version?: string; } export interface CommandDefinition extends Omit { options: TOptions; run: (options: z.output) => Promise; schema: TSchema; } /** * Defines a command. * * @param definition - Command metadata and children. */ export declare function defineCommand(definition: Command): Command; /** * Defines a command that parses and validates options before running it. * * @param definition - Command metadata, native options, schema, and runner. */ export declare function defineCommand(definition: CommandDefinition): CommandDefinition & Command; /** * Returns every direct child command, including grouped root commands. * * @param command - Parent command. */ export declare function getSubcommands(command: Command): Command[]; /** * Returns whether an option appears before the positional terminator. * * @param rawArgs - Raw CLI arguments. * @param options - Option spellings to match. */ export declare function hasOption(rawArgs: readonly string[], ...options: readonly string[]): boolean; //# sourceMappingURL=command.d.ts.map