/** * Claude CLI Detection Utility * * Provides robust detection of Claude Code CLI with comprehensive validation. * Goes beyond checking if 'claude' exists - verifies it can actually run plugin commands. * * IMPORTANT: This detector handles multiple scenarios: * 1. Claude installed globally via npm (binary in PATH) * 2. Claude defined as shell function in .zshrc/.bashrc * 3. Claude defined as shell alias * * Shell functions/aliases are only visible in interactive shells, so we use * multiple detection strategies to find Claude regardless of how it's installed. */ import { getCleanEnv } from './clean-env.js'; export { getCleanEnv }; export interface ClaudeCliStatus { /** Whether Claude CLI is available and working */ available: boolean; /** Whether the claude command exists (binary, function, or alias) */ commandExists: boolean; /** Whether plugin commands work */ pluginCommandsWork: boolean; /** Claude CLI version if available */ version?: string; /** Specific error if detection failed */ error?: 'command_not_found' | 'plugin_commands_not_supported' | 'permission_denied' | 'version_check_failed' | 'unknown'; /** Error message for debugging */ errorMessage?: string; /** Full path to claude command (if binary) */ commandPath?: string; /** How claude was found: 'binary', 'function', 'alias', or 'npm-global' */ detectionMethod?: 'binary' | 'function' | 'alias' | 'npm-global'; /** Exit code from failed command */ exitCode?: number; /** Stdout from failed command (for debugging) */ debugStdout?: string; /** Stderr from failed command (for debugging) */ debugStderr?: string; /** Platform information */ platform: NodeJS.Platform; /** Whether CLI is installed but detection was via shell workaround */ shellWorkaround?: boolean; } export declare function detectClaudeCli(): ClaudeCliStatus; /** * Simple boolean check for quick availability testing * Use this when you just need a yes/no answer. * * @returns true if Claude CLI is fully functional, false otherwise */ export declare function isClaudeCliAvailable(): boolean; /** * Get human-readable diagnostic message based on CLI status * * @param status - Status from detectClaudeCli() * @returns Diagnostic message explaining the issue */ export declare function getClaudeCliDiagnostic(status: ClaudeCliStatus): string; /** * Get actionable suggestions for fixing Claude CLI issues * * @param status - Status from detectClaudeCli() * @returns Array of suggested actions */ export declare function getClaudeCliSuggestions(status: ClaudeCliStatus): string[]; //# sourceMappingURL=claude-cli-detector.d.ts.map