MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / cli

Function cli

__tests__/parse-deadline.test.ts:119–137  ·  view source on GitHub ↗

Run the CLI; a run that outlives `timeout` is killed, which `signal` then shows.

(args: string[], kernel: boolean)

Source from the content-addressed store, hash-verified

117
118 /** Run the CLI; a run that outlives `timeout` is killed, which `signal` then shows. */
119 function cli(args: string[], kernel: boolean) {
120 const t0 = Date.now();
121 const r = spawnSync(process.execPath, [BIN, ...args], {
122 cwd: tmp,
123 encoding: 'utf-8',
124 timeout: 120_000,
125 env: {
126 ...process.env,
127 CODEGRAPH_NO_DAEMON: '1',
128 CODEGRAPH_WASM_RELAUNCHED: '1',
129 CODEGRAPH_TELEMETRY: '0',
130 DO_NOT_TRACK: '1',
131 CODEGRAPH_NO_PROMPT_HOOK: '1',
132 CODEGRAPH_PARSE_TIMEOUT_MS: String(BUDGET_MS),
133 CODEGRAPH_KERNEL: kernel ? '' : '0',
134 },
135 });
136 return { ...r, ms: Date.now() - t0 };
137 }
138
139 for (const kernel of [true, false]) {
140 it.skipIf(kernel && !kernelBuilt)(`init, index and sync exit on their own (${kernel ? 'kernel' : 'wasm'})`, () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected