@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
79 lines (78 loc) • 2.42 kB
TypeScript
/**
* @fileoverview Command-line argument parser for the code review tool.
*
* This module defines and parses command-line arguments for the code review tool
* using the yargs library. It provides a consistent interface for all commands
* and ensures that required arguments are provided.
*/
import { ReviewOptions } from '../types/review';
/**
* Parse command-line arguments for the code review tool
* @returns Parsed arguments
*/
export declare function parseArguments(): any;
/**
* CLI options interface that extends ReviewOptions with CLI-specific properties
*/
export interface CliOptions extends ReviewOptions {
/** Target file or directory path */
target: string;
/** Output directory for generated files */
outputDir?: string;
/** Writer model for consolidation */
writerModel?: string;
/** API keys for different providers */
apiKey?: Record<string, string>;
/** API keys from CLI (alternative name for compatibility) */
apiKeys?: Record<string, string>;
/** Log level for logging */
logLevel?: string;
}
/**
* Map command-line arguments to review options
* @param argv Parsed command-line arguments
* @returns Review options
*/
interface ParsedArguments {
type?: string;
individual?: boolean;
output?: string;
outputDir?: string;
model?: string;
includeTests?: boolean;
includeProjectDocs?: boolean;
includeDependencyAnalysis?: boolean;
enableSemanticChunking?: boolean;
interactive?: boolean;
testApi?: boolean;
estimate?: boolean;
multiPass?: boolean;
forceSinglePass?: boolean;
contextMaintenanceFactor?: number;
noConfirm?: boolean;
confirm?: boolean;
debug?: boolean;
language?: string;
framework?: string;
listmodels?: boolean;
models?: boolean;
target?: string;
'ui-language'?: string;
uiLanguage?: string;
'google-api-key'?: string;
'openrouter-api-key'?: string;
'anthropic-api-key'?: string;
'openai-api-key'?: string;
}
export declare function mapArgsToReviewOptions(argv: ParsedArguments): ReviewOptions & {
target: string;
} & {
apiKeys?: Record<string, string>;
};
/**
* Validate and transform command-line arguments
* @param options Raw command-line options
* @returns Validated and transformed options
*/
export declare function validateArguments(options: ParsedArguments): ParsedArguments;
export {};