UNPKG

research-cli

Version:

AI-powered research assistant with web search capabilities and beautiful terminal UI

74 lines 2.35 kB
/** * Secure API key management using system keyring * Supports multiple providers with fallback mechanisms */ export type SupportedProvider = "openai" | "claude" | "gemini" | "perplexity"; export interface ProviderCredentials { apiKey: string; organizationId?: string; baseUrl?: string; } export interface KeyringTestResult { available: boolean; backend?: string; error?: string; } export declare class SecureAPIKeyManager { private static readonly SERVICE_NAME; private static readonly FALLBACK_CONFIG_PATH; private keyringAvailable; private fallbackWarningShown; /** * Test if system keyring is available and writable */ testKeyringAvailability(): Promise<KeyringTestResult>; /** * Store API key securely for a provider */ storeApiKey(provider: SupportedProvider, apiKey: string): Promise<boolean>; /** * Retrieve API key for a provider */ getApiKey(provider: SupportedProvider): Promise<string | null>; /** * Remove API key for a provider */ removeApiKey(provider: SupportedProvider): Promise<boolean>; /** * List providers with stored API keys */ listStoredProviders(): Promise<SupportedProvider[]>; /** * Store full credentials for a provider (API key + optional extras) */ storeCredentials(provider: SupportedProvider, credentials: ProviderCredentials): Promise<boolean>; /** * Get full credentials for a provider */ getCredentials(provider: SupportedProvider): Promise<ProviderCredentials | null>; /** * Migrate API keys from a config file to secure storage */ migrateFromConfig(configFilePath: string): Promise<{ migrated: number; errors: string[]; }>; /** * Interactive API key setup for a provider */ setupApiKey(provider: SupportedProvider): Promise<string | null>; /** * Test API key with a simple request (if possible) */ testApiKey(provider: SupportedProvider, apiKey?: string): Promise<{ valid: boolean; error?: string; }>; private validateApiKeyFormat; private ensureFallbackDir; private fallbackStore; private fallbackGet; private fallbackRemove; } export declare const apiKeyManager: SecureAPIKeyManager; //# sourceMappingURL=keyring-manager.d.ts.map