Skip to content

Repository files navigation

OpenMyCodex logo

OpenMyCodex

Add external model providers to Codex. Native macOS, no Node, no Python.

MIT license Latest release macOS

OpenMyCodex is a rebuild of codex-router as a single native application. The original runs a Node CLI and a LiteLLM Python proxy behind a Tauri shell. This version replaces all of it with one .app bundle, built in pure Swift and SwiftUI, with no Node.js, no Python, and no install scripts. macOS only.

What it does

Codex can point at a different OpenAI-compatible endpoint. OpenMyCodex runs that endpoint locally, translates Codex's Responses API calls into the format each provider expects, and merges the extra models into the Codex model picker.

  • Desktop app to add providers, paste API keys, and switch models on or off.
  • Menu bar companion that shares the same state as the window.
  • 25 providers and 47 models from the original registry. API-key providers store secrets in the macOS keychain; OAuth providers (Kimi Code, Grok) reuse the official CLI session and need no key.

Requirements

  • macOS 26 or later (the app uses Liquid Glass).
  • Swift 6.2 toolchain (Xcode 26 or later) to build.
  • Codex installed, so the app can read its native model catalog.

Install (DMG)

Download OpenMyCodex.dmg, open it, and drag OpenMyCodex.app to Applications.

The app is not code-signed (no Apple Developer license). On first launch macOS Gatekeeper will refuse to open it. This is expected and safe — the binary is built from this repository's source. To allow it:

  • Right-click the app and choose Open, then confirm, or
  • Open System Settings → Privacy & Security, scroll to the banner about OpenMyCodex, and click Open Anyway.

You only do this once; later launches open normally.

Build from source

./build-app.sh release
open build/OpenMyCodex.app

The bundle is self-contained. There is nothing else to install.

How to use it

  1. Pick a provider in the sidebar.
  2. Paste its API key. The key goes straight to your keychain.
  3. Turn the provider on.
  4. Press Connect.
  5. Restart Codex so it reloads the model list.

Press Disconnect to put Codex back exactly as it was.

How your Codex config is treated

The app edits only three root keys in ~/.codex/config.toml: openai_base_url, model_catalog_json, and model.

Before the first edit it snapshots the previous value of each key, and keeps a verbatim copy of the whole file next to it. Disconnecting restores those values and deletes any key that was absent before. Comments, tables, blank lines, and every other setting are left untouched.

This is verified against a real 293-line config: after a full connect and disconnect cycle the file's SHA-256 is unchanged.

If another router already owns the config, the app reports it instead of silently taking over, and restores that router's settings on disconnect.

Security

  • The server binds 127.0.0.1 only, on the loopback interface.
  • Every routed request must carry a 128-bit capability token in its URL path. Without it the router returns 404, so no other local process can drive it.
  • Requests carrying an Origin header are refused, so a web page cannot reach the router even if it guesses the port.
  • Each request is sent upstream with only that provider's own credential. The Codex-supplied Authorization, chatgpt-account-id, and openai-organization headers are dropped rather than forwarded. This is covered by a test that inspects what the upstream actually received.
  • A model whose provider is switched off is refused with a 403. It never falls through to Codex's native backend.
  • State files are written atomically with 0600 permissions.

Layout

Sources/RouterCore/        Registry, translation, streaming, server, install
Sources/OpenMyCodexApp/    SwiftUI window, menu bar extra, settings
Tests/RouterCoreTests/     142 tests

Tests

swift test

151 tests across 22 suites. They cover the Responses translation, SSE framing, catalog merging against the real Codex binary, config editing, credential isolation, OAuth session detection, and a full request round trip over a real socket to a mock provider.

Tests that need Codex installed, or a real config, skip themselves when those are absent.

License

MIT. See LICENSE.

About

Native macOS app that routes external AI providers into OpenAI Codex. Pure Swift/SwiftUI, no Node/Python.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages