import { Common } from '@rsdoctor/types'; import type { Command as CACCommand } from 'cac'; export interface Command { (ctx: CommandContext): CommandOutput; } export interface CommandContext { name: string; bin: string; cwd: string; } export interface CommandOutput { command: CMD; description: string; options(cli: CACCommand): void; action(args: Options): Result | Promise; } export type GetCommandArgumentsType = T extends Command ? { command: C; options: Options; result: Result; } : unknown;