import type { MeowFlags } from '../flags.mts'; import type { Options, Result } from 'meow'; export interface CliAlias { description: string; argv: readonly string[]; hidden?: boolean | undefined; } export type CliAliases = Record; export type CliSubcommandRun = (argv: string[] | readonly string[], importMeta: ImportMeta, context: { parentName: string; rawArgv?: readonly string[]; }) => Promise | void; export interface CliSubcommand { description: string; hidden?: boolean | undefined; run: CliSubcommandRun; } // Property names are picked such that the name is at the top when the props // get ordered by alphabet while flags is near the bottom and the help text // at the bottom, because they tend ot occupy the most lines of code. export interface CliCommandConfig { commandName: string; description: string; hidden: boolean; flags: MeowFlags; help: (command: string, config: CliCommandConfig) => string; } export interface CliCommandContext { parentName: string; rawArgv?: string[] | readonly string[]; } export interface MeowConfig { name: string; argv: string[] | readonly string[]; importMeta: ImportMeta; subcommands: Record; } export interface MeowOptions extends Omit, 'argv' | 'importMeta'> { aliases?: CliAliases | undefined; // When no sub-command is given, default to this sub-command. defaultSub?: string | undefined; } /** * Emit the Socket CLI banner to stderr for branding and debugging. */ export declare function emitBanner(name: string, orgFlag: string | undefined, compactMode?: boolean): void; /** * Get the last command that was processed by meowOrExit (for debugging). */ export declare function getLastSeenCommand(): string; /** * Main function for handling CLI with subcommands using meow. * @param config Configuration object with name, argv, importMeta, and subcommands. * @param options Optional settings like aliases and defaultSub. * @example * meowWithSubcommands( * { name, argv, importMeta, subcommands }, * { aliases, defaultSub } * ) */ export declare function meowWithSubcommands(config: MeowConfig, options?: MeowOptions | undefined): Promise; export interface MeowOrExitConfig { argv: string[] | readonly string[]; config: CliCommandConfig; parentName: string; importMeta: ImportMeta; } export type MeowOrExitOptions = { allowUnknownFlags?: boolean | undefined; }; /** * Create meow CLI instance or exit with help/error (meow will exit immediately * if it calls .showHelp()). * @param config Configuration object with argv, config, parentName, and importMeta. * @param options Optional settings like allowUnknownFlags. * @example * meowOrExit( * { argv, config, parentName, importMeta }, * { allowUnknownFlags: false } * ) */ export declare function meowOrExit(config: MeowOrExitConfig, options?: MeowOrExitOptions | undefined): Result; //# sourceMappingURL=meow-with-subcommands.d.mts.map