UNPKG

ds-sfcoe-ailabs

Version:

AI-powered code review tool with static analysis integration for comprehensive code quality assessment.

78 lines (76 loc) 4.24 kB
/** * @fileoverview Message constants for the AI Code Reviewer CLI tool * Simple message constants that replace the Salesforce Messages framework with straightforward constants * Contains command descriptions, examples, and flag documentation for the pr-review command * * @example * ```typescript * import { MESSAGES } from './messages'; * * const prReviewCommand = MESSAGES['pr-review']; * console.log(prReviewCommand.summary); * console.log(prReviewCommand.flags.aiProvider); * ``` */ /** * Message constants organized by command name * Contains comprehensive documentation for CLI commands including descriptions, examples, and flag definitions */ export const MESSAGES = { /** * Configuration for the 'pr-review' command * Provides AI-powered code review functionality with multiple provider support */ 'pr-review': { /** Brief one-line summary of what the command does */ summary: 'Analyze code changes between commits using AI-powered review', /** Detailed description of the command's functionality and features */ description: `Performs comprehensive AI-assisted code review by: • Analyzing differences between specified Git commits or branches • Running static code analysis (Salesforce Code Analyzer + PMD) • Generating intelligent review comments using AI providers • Optionally posting review comments to pull requests`, /** Array of practical usage examples showing different command variations */ examples: [ 'ds-sfcoe-ailabs pr-review --repo-dir ./ --ai-provider OpenAI --ai-model gpt-4 --ai-token $OPENAI_TOKEN', 'ds-sfcoe-ailabs pr-review --from main --to feature-branch --ai-provider Anthropic --ai-model claude-3-sonnet --ai-token $ANTHROPIC_TOKEN', 'ds-sfcoe-ailabs pr-review --pull-request-id 123 --git-provider GitHub --git-token $GITHUB_TOKEN --ai-provider AzureOpenAI --ai-model gpt-4o --ai-token $AZURE_TOKEN --git-owner myorg --git-repo myrepo', ], /** * Flag definitions with descriptions for command-line options * Each flag provides help text explaining its purpose and usage */ flags: { /** Path to Git repository directory (default: current directory) */ repoDir: 'Path to Git repository directory (default: current directory)', /** Source commit/branch for diff comparison (default: HEAD~1) */ from: 'Source commit/branch for diff comparison (default: HEAD~1)', /** Target commit/branch for diff comparison (default: HEAD) */ to: 'Target commit/branch for diff comparison (default: HEAD)', /** Pull request ID for posting review comments */ pullRequestId: 'Pull request ID for posting review comments', /** Path to Salesforce Code Analyzer configuration file (YAML format) */ sfConfigFile: 'Path to Salesforce Code Analyzer configuration file (YAML format)', /** Path to PMD configuration file (XML ruleset format) */ pmdConfigFile: 'Path to PMD configuration file (XML ruleset format)', /** AI service provider: OpenAI, AzureOpenAI, or Anthropic */ aiProvider: 'AI service provider: OpenAI, AzureOpenAI, or Anthropic', /** Authentication token for AI provider */ aiToken: 'Authentication token for AI provider', /** AI model identifier (e.g., gpt-4, claude-3-sonnet) */ aiModel: 'AI model identifier (e.g., gpt-4, claude-3-sonnet)', /** Custom AI API endpoint URL */ aiApiEndpoint: 'Custom AI API endpoint URL', /** AI API version */ aiApiVersion: 'AI API version', /** Git hosting provider (currently supports GitHub) */ gitProvider: 'Git hosting provider (currently supports GitHub)', /** Authentication token for git provider */ gitToken: 'Authentication token for git provider', /** Git repository owner/organization name */ gitOwner: 'Git repository owner/organization name', /** Git repository name */ gitRepo: 'Git repository name', }, }, };