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

Function cli

__tests__/sqlite-open-error.test.ts:206–213  ·  view source on GitHub ↗

Run the built CLI; output with colour codes removed.

(args: string[], nodeFlags: string[] = [])

Source from the content-addressed store, hash-verified

204
205/** Run the built CLI; output with colour codes removed. */
206function cli(args: string[], nodeFlags: string[] = []): { status: number | null; output: string } {
207 const r = spawnSync(process.execPath, [...nodeFlags, '--liftoff-only', '--disable-warning=ExperimentalWarning', BIN, ...args], {
208 encoding: 'utf8',
209 env: { ...process.env, CODEGRAPH_NO_DAEMON: '1', CODEGRAPH_TELEMETRY: '0', DO_NOT_TRACK: '1', CODEGRAPH_NO_UPDATE_CHECK: '1', NO_COLOR: '1' },
210 timeout: 120_000,
211 });
212 return { status: r.status, output: `${r.stdout}${r.stderr}`.replace(/\x1b\[[0-9;]*m/g, '') };
213}
214
215describe('the CLI', () => {
216 it.runIf(process.platform === 'win32')('names the SQLite failure in status, sync and query', async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected