MCPcopy Create free account
hub / github.com/SethGammon/Citadel / main

Function main

scripts/operator-console.js:408–431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406}
407
408function main() {
409 const args = parseArgs(process.argv.slice(2));
410 if (args.help) {
411 process.stdout.write(`${usage()}\n`);
412 return;
413 }
414
415 const consoleState = buildConsole(args.projectRoot, {
416 run: args.run,
417 maxSteps: args.maxSteps,
418 });
419
420 if (args.summary) process.stdout.write(`${JSON.stringify(consoleState.summary, null, 2)}\n`);
421 else if (args.json) process.stdout.write(`${JSON.stringify(consoleState, null, 2)}\n`);
422 else {
423 process.stdout.write(renderConsole(consoleState));
424 process.stdout.write(`Report: ${consoleState.reportPath}\n`);
425 }
426
427 if (consoleState.status === 'failed') {
428 const failed = consoleState.decision.steps.find((step) => step.result.status !== 0);
429 process.exitCode = failed?.result.status || 1;
430 }
431}
432
433if (require.main === module) main();
434

Callers 1

Calls 4

buildConsoleFunction · 0.85
renderConsoleFunction · 0.85
parseArgsFunction · 0.70
usageFunction · 0.70

Tested by

no test coverage detected