UNPKG

@xec-sh/cli

Version:

Xec: The Universal Shell for TypeScript

41 lines (40 loc) 1.61 kB
import { Command } from 'commander'; import { CommandRegistry } from '@xec-sh/core'; export interface DiscoveredCommand { name: string; type: 'built-in' | 'dynamic'; path: string; description?: string; loaded?: boolean; error?: string; } export declare class CommandManager { private commands; private registry; discoverAll(): Promise<DiscoveredCommand[]>; discoverBuiltInCommands(): Promise<DiscoveredCommand[]>; discoverDynamicCommands(): Promise<DiscoveredCommand[]>; private discoverCommandsInDirectory; private getDynamicCommandDirectories; private isCommandFile; private extractCommandDescription; loadCommandModule(filePath: string): Promise<{ description?: string; aliases?: string[]; usage?: string; }>; buildRegistry(program: Command): CommandRegistry; private extractCommandInfo; registerCliCommands(program: Command): CommandRegistry; getRegistry(): CommandRegistry; getCommands(): DiscoveredCommand[]; getBuiltInCommands(): DiscoveredCommand[]; getDynamicCommands(): DiscoveredCommand[]; hasCommand(name: string): boolean; } export declare function getCommandManager(): CommandManager; export declare function discoverAllCommands(): Promise<DiscoveredCommand[]>; export declare function buildCommandRegistry(program: Command): CommandRegistry; export declare function registerCliCommands(program: Command): CommandRegistry; export declare function findCommand(program: Command, nameOrAlias: string): Command | null; export { getCommandManager as getCommandDiscovery };