MCPcopy
hub / github.com/openai/codex-plugin-cc / handleSetup

Function handleSetup

plugins/codex/scripts/codex-companion.mjs:215–239  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

213}
214
215async function handleSetup(argv) {
216 const { options } = parseCommandInput(argv, {
217 valueOptions: ["cwd"],
218 booleanOptions: ["json", "enable-review-gate", "disable-review-gate"]
219 });
220
221 if (options["enable-review-gate"] && options["disable-review-gate"]) {
222 throw new Error("Choose either --enable-review-gate or --disable-review-gate.");
223 }
224
225 const cwd = resolveCommandCwd(options);
226 const workspaceRoot = resolveCommandWorkspace(options);
227 const actionsTaken = [];
228
229 if (options["enable-review-gate"]) {
230 setConfig(workspaceRoot, "stopReviewGate", true);
231 actionsTaken.push(`Enabled the stop-time review gate for ${workspaceRoot}.`);
232 } else if (options["disable-review-gate"]) {
233 setConfig(workspaceRoot, "stopReviewGate", false);
234 actionsTaken.push(`Disabled the stop-time review gate for ${workspaceRoot}.`);
235 }
236
237 const finalReport = await buildSetupReport(cwd, actionsTaken);
238 outputResult(options.json ? finalReport : renderSetupReport(finalReport), options.json);
239}
240
241function buildAdversarialReviewPrompt(context, focusText) {
242 const template = loadPromptTemplate(ROOT_DIR, "adversarial-review");

Callers 1

mainFunction · 0.85

Calls 7

setConfigFunction · 0.90
renderSetupReportFunction · 0.90
parseCommandInputFunction · 0.85
resolveCommandCwdFunction · 0.85
resolveCommandWorkspaceFunction · 0.85
buildSetupReportFunction · 0.85
outputResultFunction · 0.85

Tested by

no test coverage detected