|
1 | 1 | import { runBranchesAll, runBranchesDefault, runBranchesUpdateDefault } from './branches.js'; |
2 | 2 | import { runFeatureFlagsGet, runFeatureFlagsUpdate } from './feature-flags.js'; |
3 | 3 | import { runAnalysisFeatureFlagsGet, runAnalysisFeatureFlagsUpdate } from './analysis-feature-flags.js'; |
| 4 | +import { runPrInstructionsGet, runPrInstructionsSave, runPrInstructionsEdit, runPrInstructionsDelete } from './pr-instructions.js'; |
4 | 5 |
|
5 | 6 | /** |
6 | 7 | * Register all `codeant settings <verb>` subcommands. |
@@ -75,4 +76,56 @@ export default function registerSettingsCommands(program, { runCmd }) { |
75 | 76 | .requiredOption('--repo <repo>', 'Repository (owner/repo)') |
76 | 77 | .requiredOption('--flags <json>', 'Feature flags as a JSON string (e.g. \'{"sast_analysis":"enabled"}\')') |
77 | 78 | .action((opts) => runCmd(() => runAnalysisFeatureFlagsUpdate({ repo: opts.repo, flags: opts.flags }))); |
| 79 | + |
| 80 | + // ── pr-instructions get ──────────────────────────────────────────────────── |
| 81 | + settings |
| 82 | + .command('pr-instructions-get') |
| 83 | + .description('Get PR review instructions') |
| 84 | + .option('--type <type>', 'Instruction type (e.g. custom)') |
| 85 | + .action((opts) => runCmd(() => runPrInstructionsGet({ instructionsType: opts.type }))); |
| 86 | + |
| 87 | + // ── pr-instructions save ─────────────────────────────────────────────────── |
| 88 | + settings |
| 89 | + .command('pr-instructions-save') |
| 90 | + .description('Save a new PR review instruction') |
| 91 | + .option('--type <type>', 'Instruction type (e.g. custom)') |
| 92 | + .option('--file-pattern <pattern>', 'File pattern (e.g. *.py)') |
| 93 | + .option('--description <text>', 'Instruction description') |
| 94 | + .option('--description-file <path>', 'Path to a file containing the description') |
| 95 | + .option('--instruction-id <id>', 'Instruction ID (for upsert)') |
| 96 | + .action((opts) => runCmd(() => runPrInstructionsSave({ |
| 97 | + instructionType: opts.type, |
| 98 | + filePattern: opts.filePattern, |
| 99 | + description: opts.description, |
| 100 | + descriptionFile: opts.descriptionFile, |
| 101 | + instructionId: opts.instructionId, |
| 102 | + }))); |
| 103 | + |
| 104 | + // ── pr-instructions edit ─────────────────────────────────────────────────── |
| 105 | + settings |
| 106 | + .command('pr-instructions-edit') |
| 107 | + .description('Edit an existing PR review instruction') |
| 108 | + .requiredOption('--instruction-id <id>', 'Instruction ID to edit') |
| 109 | + .option('--type <type>', 'Instruction type (e.g. custom)') |
| 110 | + .option('--description <text>', 'Updated description') |
| 111 | + .option('--description-file <path>', 'Path to a file containing the description') |
| 112 | + .option('--file-pattern <pattern>', 'Updated file pattern') |
| 113 | + .action((opts) => runCmd(() => runPrInstructionsEdit({ |
| 114 | + instructionType: opts.type, |
| 115 | + instructionId: opts.instructionId, |
| 116 | + description: opts.description, |
| 117 | + descriptionFile: opts.descriptionFile, |
| 118 | + filePattern: opts.filePattern, |
| 119 | + }))); |
| 120 | + |
| 121 | + // ── pr-instructions delete ───────────────────────────────────────────────── |
| 122 | + settings |
| 123 | + .command('pr-instructions-delete') |
| 124 | + .description('Delete a PR review instruction') |
| 125 | + .requiredOption('--instruction-id <id>', 'Instruction ID to delete') |
| 126 | + .option('--type <type>', 'Instruction type (e.g. custom)') |
| 127 | + .action((opts) => runCmd(() => runPrInstructionsDelete({ |
| 128 | + instructionType: opts.type, |
| 129 | + instructionId: opts.instructionId, |
| 130 | + }))); |
78 | 131 | } |
0 commit comments