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

Function main

scripts/next-action.js:475–501  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

473}
474
475function main() {
476 const args = parseArgs(process.argv.slice(2));
477 if (args.help) {
478 process.stdout.write(`${usage()}\n`);
479 return;
480 }
481
482 const report = resolveNext(args.projectRoot, {
483 run: args.run,
484 maxSteps: args.maxSteps,
485 });
486 if (report.approvalCapsule) {
487 writeApprovalCapsule(path.resolve(args.projectRoot), report.approvalCapsule);
488 }
489 report.reportPath = writeReport(path.resolve(args.projectRoot), report);
490
491 if (args.json) process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
492 else {
493 process.stdout.write(render(report));
494 process.stdout.write(`Report: ${report.reportPath}\n`);
495 }
496
497 if (report.outcome === 'failed') {
498 const failed = report.steps.find((step) => step.result.status !== 0);
499 process.exitCode = failed?.result.status || 1;
500 }
501}
502
503if (require.main === module) main();
504

Callers 1

next-action.jsFile · 0.70

Calls 6

resolveNextFunction · 0.85
writeApprovalCapsuleFunction · 0.85
parseArgsFunction · 0.70
usageFunction · 0.70
writeReportFunction · 0.70
renderFunction · 0.70

Tested by

no test coverage detected