UNPKG

@kya-os/cli

Version:

CLI for MCP-I setup and management

122 lines 3.25 kB
export interface EnvVariables { AGENT_PRIVATE_KEY: string; AGENT_KEY_ID: string; AGENT_DID: string; AGENT_PUBLIC_KEY?: string; AGENT_NAME?: string; AGENT_DESCRIPTION?: string; AGENT_GITHUB_REPO?: string; BASE_URL?: string; KYA_VOUCHED_API_KEY: string; VOUCHED_API_KEY?: string; } export interface EnvFile { path: string; filename: string; exists: boolean; writable: boolean; hasmcpidentity: boolean; xmcpVariables: Partial<EnvVariables>; } export interface EnvInsertionResult { success: boolean; targetFile: string; operation: "created" | "updated" | "replaced"; warnings: string[]; conflicts?: { file: string; variable: string; value: string; }[]; } export declare class EnvManager { private projectRoot; constructor(projectRoot?: string); /** * Scan for all .env files with detailed analysis */ scanEnvFiles(): EnvFile[]; /** * Determine the best target file using precedence rules */ selectTargetEnvFile(envFiles: EnvFile[]): { target: EnvFile | null; warnings: string[]; }; /** * Check for conflicts across multiple .env files */ detectConflicts(envFiles: EnvFile[], newVariables: EnvVariables): { file: string; variable: string; value: string; }[]; /** * Smart insertion/update of MCP-I variables */ smartInsertMcpVariables(variables: EnvVariables, options?: { force?: boolean; }): Promise<EnvInsertionResult>; /** * Parse .env file and extract MCP-I variables */ private parseEnvFile; /** * Create a new .env file */ private createEnvFile; /** * Update existing .env file by replacing MCP-I variables */ private updateExistingEnvFile; /** * Append MCP-I variables to existing .env file */ private appendToEnvFile; /** * Find existing .env files in the project */ findExistingEnvFiles(): string[]; /** * Update or create environment file, merging with existing content */ updateEnvFile(filename: string, variables: EnvVariables, options?: { force?: boolean; example?: boolean; }): Promise<void>; /** * Read environment variables from file */ readEnvFile(filename: string): Partial<EnvVariables>; /** * Check if .gitignore includes env files */ checkGitignore(envFiles: string[]): { missing: string[]; ignored: string[]; }; /** * Add files to .gitignore */ addToGitignore(files: string[]): void; /** * Get environment variables from process.env */ getFromProcess(): Partial<EnvVariables>; /** * Format environment variables for display */ formatForDisplay(vars: Partial<EnvVariables>, hideSecrets?: boolean): string; /** * Format for clipboard (no masking) */ formatForClipboard(vars: Partial<EnvVariables>): string; /** * Check if all required variables are present */ validateVariables(vars: Partial<EnvVariables>): { valid: boolean; missing: string[]; }; } //# sourceMappingURL=env-manager.d.ts.map