MCPcopy Create free account
hub / github.com/cli/cli / main

Function main

evals/src/replay.ts:45–66  ·  view source on GitHub ↗
(argv = process.argv.slice(2))

Source from the content-addressed store, hash-verified

43No GitHub credentials, model token, network access, or live resources are used.`;
44
45export async function main(argv = process.argv.slice(2)): Promise<void> {
46 let json = false;
47 const paths: string[] = [];
48 for (const arg of argv) {
49 if (arg === "--help" || arg === "-h") { console.log(usage); return; }
50 if (arg === "--json") json = true;
51 else if (arg.startsWith("-")) throw new Error(`Unknown option: ${arg}\n${usage}`);
52 else paths.push(arg);
53 }
54 if (!paths.length) throw new Error(usage);
55 const results = await Promise.all(paths.map(replay));
56 if (json) console.log(JSON.stringify(results, null, 2));
57 else {
58 for (const item of results) {
59 console.log(`${item.passed ? "PASS" : "FAIL"} ${item.scenario} ${item.path}`);
60 for (const grader of item.graders) {
61 console.log(` ${grader.passed ? "PASS" : "FAIL"} ${grader.name}: ${grader.evidence}`);
62 }
63 }
64 }
65 if (results.some(result => !result.passed)) process.exitCode = 1;
66}
67
68if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
69 main().catch(error => {

Callers 1

replay.tsFile · 0.70

Calls 2

logMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected