MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveCodexCli

Function resolveCodexCli

packages/plugins/mcp/src/sdk/codex-plugins.ts:112–127  ·  view source on GitHub ↗
(codexCli?: string)

Source from the content-addressed store, hash-verified

110 * executor server usually inherits the user's shell PATH), then the common
111 * install locations for launch contexts that do not. */
112const resolveCodexCli = (codexCli?: string): string | undefined => {
113 if (codexCli !== undefined) return isExecutableFile(codexCli) ? codexCli : undefined;
114 const dirs = [
115 ...(process.env["PATH"] ?? "").split(path.delimiter),
116 path.join(os.homedir(), ".bun", "bin"),
117 path.join(os.homedir(), ".local", "bin"),
118 "/opt/homebrew/bin",
119 "/usr/local/bin",
120 ];
121 for (const dir of dirs) {
122 if (dir.length === 0) continue;
123 const candidate = path.join(dir, "codex");
124 if (isExecutableFile(candidate)) return candidate;
125 }
126 return undefined;
127};
128
129// ---------------------------------------------------------------------------
130// Manifest shapes — only the fields discovery needs. Everything else in the

Callers 1

scanCodexPluginsFunction · 0.85

Calls 1

isExecutableFileFunction · 0.85

Tested by

no test coverage detected