export interface FlagDescriptor { kind: K; description?: string; char?: string; default?: unknown; multiple?: boolean; options?: readonly string[]; required?: boolean; /** The string value may be omitted; parsers decide whether to consume it. */ optionalValue?: boolean; } export interface ArgDescriptor { kind: "string"; description?: string; required?: boolean; multiple?: boolean; options?: readonly string[]; } interface FlagInput { description?: string; char?: string; default?: unknown; multiple?: boolean; options?: readonly string[]; required?: boolean; /** The string value may be omitted; parsers decide whether to consume it. */ optionalValue?: boolean; } interface ArgInput { description?: string; required?: boolean; multiple?: boolean; options?: readonly string[]; } /** Builders that match the `Flags.*()` / `Args.*()` API from oclif. */ export declare const Flags: { string(opts?: T): FlagDescriptor<"string"> & T; boolean(opts?: T): FlagDescriptor<"boolean"> & T; integer(opts?: T): FlagDescriptor<"integer"> & T; }; export declare const Args: { string(opts?: T): ArgDescriptor & T; }; /** * Thrown when CLI argument/flag parsing or validation fails (unknown flag, * bad option value, missing required arg, etc.). `run()` catches this to print * the message and render usage instead of crashing as an uncaught exception. */ export declare class CliParseError extends Error { constructor(message: string); } type FlagValue = D["kind"] extends "boolean" ? D extends { default: boolean; } ? boolean : boolean | undefined : D["kind"] extends "integer" ? D extends { default: number; } ? number : number | undefined : D extends { multiple: true; } ? string[] | undefined : string | undefined; type ArgValue = D extends { multiple: true; } ? string[] | undefined : string | undefined; type FlagValues> = { [K in keyof T]: FlagValue; }; type ArgValues> = { [K in keyof T]: ArgValue; }; export interface ParseOutput = Record, A extends Record = Record> { flags: FlagValues; args: ArgValues; argv: string[]; } export interface CommandCtor { new (argv: string[], config: CliConfig): Command; description?: string; hidden?: boolean; strict?: boolean; aliases?: string[]; examples?: string[]; flags?: Record; args?: Record; delegateHelp?: boolean; } /** Configuration passed to every command instance and help renderers. */ export interface CliConfig { bin: string; version: string; /** All registered commands keyed by their canonical name. */ commands: Map; } /** Minimal Command base matching the oclif surface we use. */ export declare abstract class Command { argv: string[]; config: CliConfig; constructor(argv: string[], config: CliConfig); abstract run(): Promise; /** * Parse argv against the static `flags` and `args` declared on the * concrete command class. Returns a typed `{ flags, args, argv }` object. */ parse(_Cmd: C): Promise extends Record ? NonNullable : Record, NonNullable extends Record ? NonNullable : Record>>; } /** Render full root help: header, default command details, subcommand list. */ export declare function renderRootHelp(config: CliConfig): void; /** Render help for a single command. */ export declare function renderCommandHelp(bin: string, id: string, Cmd: CommandCtor): void; /** A lazily-loaded command: canonical name, loader, and optional aliases. */ export interface CommandEntry { name: string; load: () => Promise; aliases?: string[]; /** Owns parsing, help, loading and failures for this family when supplied. */ dispatch?: (argv: string[], context: CommandEntryContext) => Promise; } export interface CommandEntryContext { bin: string; version: string; /** Canonical registered entry name, including when invoked through an alias. */ command: string; } export interface RunOptions { bin: string; version: string; argv: string[]; commands: CommandEntry[]; /** Custom help renderer. Receives fully-populated config. */ help?: (config: CliConfig) => Promise | void; } /** * Main entry point — replaces `run()` from @oclif/core. * * Each command is explicitly registered with a lazy loader. * No filesystem scanning, no plugin system, no package.json reading. */ export declare function run(opts: RunOptions): Promise; export {};