Skip to content

feat: add CODEX_PATH env var for custom binary path (macOS Gatekeeper fix)#5

Open
glenhsu wants to merge 2 commits into
benedict2310:mainfrom
glenhsu:fix/codex-path-override
Open

feat: add CODEX_PATH env var for custom binary path (macOS Gatekeeper fix)#5
glenhsu wants to merge 2 commits into
benedict2310:mainfrom
glenhsu:fix/codex-path-override

Conversation

@glenhsu

@glenhsu glenhsu commented May 14, 2026

Copy link
Copy Markdown

Summary

Adds CODEX_PATH environment variable support so users can override the codex binary path — a fix for macOS Gatekeeper silently deleting the SDK-bundled binary.

Changes

.env.example

  • Added CODEX_PATH env var with documentation (optional override for codex binary path)
  • Added OMLX_API_KEY as commented example for custom provider setup

src/codex-session.ts (resetCodexClient)

  • Checks for process.env["CODEX_PATH"] and passes it as codexPathOverride to the Codex constructor
  • Refactored Codex initialization to use an options object approach

README.md

  • Added Troubleshooting section with two common issues:
    • ❌ "Missing environment variable: OMLX_API_KEY"
    • ❌ "Failed to spawn Codex CLI: EACCES" (macOS Gatekeeper)

Why

macOS Gatekeeper on Sequoia silently quarantines and deletes the SDK-bundled codex binary at node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex/ — no UI prompt, no entry in System Settings. The SDK then fails with EACCES.

With CODEX_PATH, users point to their homebrew-installed binary (/opt/homebrew/bin/codex) and bypass Gatekeeper entirely.

Also includes a complementary setup guide with full step-by-step instructions: https://github.com/glenhsu/telecodex-codex-cli-setup

@gugglegum

Copy link
Copy Markdown

Dude, you beat me to it by 48 minutes. :) I think you forgot to commit the changes to src/codex-session.ts, and I think my version is better because the option goes through the config and is covered by tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants