export interface ExternalCliInstall { mac?: string; linux?: string; windows?: string; default?: string; } export interface ExternalCliConfig { /** User-facing OpenCLI subcommand and, by default, the executable name. */ name: string; binary: string; /** * Display alias rendered alongside `name` in help/listing as `name(package)`. * Use either the upstream distribution/project name (e.g. `tg-cli`, `discord-cli`) * or a human-readable brand label (e.g. `notion`, `企业微信`) when the bare * executable name is ambiguous. */ package?: string; description?: string; homepage?: string; tags?: string[]; install?: ExternalCliInstall; } export declare function loadExternalClis(): ExternalCliConfig[]; export declare function isBinaryInstalled(binary: string): boolean; export declare function getInstallCmd(installConfig?: ExternalCliInstall): string | null; export declare function formatExternalCliLabel(cli: ExternalCliConfig): string; /** * Safely parses a command string into a binary and argument list. * Rejects commands containing shell operators (&&, ||, |, ;, >, <, `) that * cannot be safely expressed as execFileSync arguments. * * Args: * cmd: Raw command string from YAML config (e.g. "brew install gh") * * Returns: * Object with `binary` and `args` fields, or throws on unsafe input. */ export declare function parseCommand(cmd: string): { binary: string; args: string[]; }; export declare function installExternalCli(cli: ExternalCliConfig): boolean; export declare function executeExternalCli(name: string, args: string[], preloaded?: ExternalCliConfig[]): void; export interface RegisterOptions { binary?: string; install?: string; description?: string; } export declare function registerExternalCli(name: string, opts?: RegisterOptions): void;