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

Function resolveCodexInvocation

scripts/codex-app-server-capture.js:32–41  ·  view source on GitHub ↗
(codexBin)

Source from the content-addressed store, hash-verified

30}
31
32function resolveCodexInvocation(codexBin) {
33 if (codexBin) return { command: codexBin, prefixArgs: [], shell: process.platform === 'win32' };
34 if (process.platform === 'win32' && process.env.APPDATA) {
35 const codexJs = path.join(process.env.APPDATA, 'npm', 'node_modules', '@openai', 'codex', 'bin', 'codex.js');
36 if (fs.existsSync(codexJs)) {
37 return { command: process.execPath, prefixArgs: [codexJs], shell: false };
38 }
39 }
40 return { command: 'codex', prefixArgs: [], shell: process.platform === 'win32' };
41}
42
43function jsonl(messages) {
44 return messages.map((msg) => JSON.stringify(msg)).join('\n') + (messages.length ? '\n' : '');

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected