@re-shell/cli
Version:
Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja
54 lines (53 loc) • 2.13 kB
TypeScript
import { CommandDefinition } from './command-registry';
export interface CompletionConfig {
enableFileCompletion: boolean;
enableDirectoryCompletion: boolean;
enableCommandCompletion: boolean;
enableOptionCompletion: boolean;
enableValueCompletion: boolean;
customCompletions: Record<string, CompletionProvider>;
}
export interface CompletionProvider {
(current: string, previous: string[], context: CompletionContext): Promise<string[]> | string[];
}
export interface CompletionContext {
command: string;
subcommand?: string;
option?: string;
cwd: string;
env: Record<string, string>;
}
export interface ShellCompletionScript {
shell: 'bash' | 'zsh' | 'fish' | 'powershell';
script: string;
installPath: string;
instructions: string;
}
export declare class CompletionSystem {
private config;
private commands;
private customProviders;
constructor(config?: Partial<CompletionConfig>);
private setupBuiltinProviders;
registerCommand(command: CommandDefinition): void;
unregisterCommand(name: string): void;
registerProvider(name: string, provider: CompletionProvider): void;
complete(args: string[], current: string, context: CompletionContext): Promise<string[]>;
private completeCommands;
private completeOptions;
private completeOptionValues;
private getProviderForOption;
private completeArguments;
private getProviderForArgument;
private completeFiles;
generateShellCompletions(programName: string): ShellCompletionScript[];
private generateBashCompletion;
private generateZshCompletion;
private generateFishCompletion;
private generatePowerShellCompletion;
installCompletion(shell: 'bash' | 'zsh' | 'fish' | 'powershell', programName: string): Promise<void>;
handleCompletionRequest(args: string[]): Promise<void>;
}
export declare function createCompletionSystem(config?: Partial<CompletionConfig>): CompletionSystem;
export declare function getGlobalCompletion(): CompletionSystem;
export declare function setGlobalCompletion(completion: CompletionSystem): void;