UNPKG

review-copilot

Version:

ReviewCopilot - AI-powered code review assistant with customizable prompts

46 lines (45 loc) 1.92 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const init_1 = require("./commands/init"); const review_1 = require("./commands/review"); const selective_review_1 = require("./commands/selective-review"); const package_json_1 = require("../../package.json"); const program = new commander_1.Command(); program .name('review-copilot') .description('AI-powered code review assistant') .version(package_json_1.version); program .command('init') .description('Initialize ReviewCopilot configuration') .action(init_1.initCommand); program .command('review') .description('Review all changes in the current PR') .option('-c, --config <path>', 'Path to the config file', '.review-copilot.yaml') .option('-b, --base-branch <branch>', 'Base branch to compare against', 'main') .action(async (options) => { const success = await (0, review_1.reviewCommand)(options); if (!success) { process.exit(1); } }); program .command('selective-review') .description('Review specific code in a PR based on a comment') .option('-c, --config <path>', 'Path to the config file', '.review-copilot.yaml') .requiredOption('-f, --file <path>', 'Path to the file to review') .requiredOption('-s, --start-line <number>', 'Start line number', parseInt) .requiredOption('-e, --end-line <number>', 'End line number', parseInt) .requiredOption('-m, --comment <text>', 'The comment that triggered the review') .option('--comment-id <number>', 'ID of the comment that triggered the review', parseInt) .option('--thread-id <string>', 'ID of the comment thread for review comments') .action(async (options) => { const success = await (0, selective_review_1.selectiveReviewCommand)(options); if (!success) { process.exit(1); } }); program.parse();