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

Function resolveCodexCli

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

Source from the content-addressed store, hash-verified

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