@kevin0181/rcodex
v0.1.8
Published
Gateway and provider manager for Codex: Claude, GPT, Gemini, Ollama, Antigravity, and Copilot via a single local proxy
Maintainers
Readme
rcodex
A local AI gateway that lets Codex talk to Claude, OpenAI, Gemini, Ollama, Antigravity, and GitHub Copilot through one local Responses-compatible proxy with a visual routing UI.

Features
- Multi-provider routing for Anthropic Claude, OpenAI, Google Gemini, Ollama, Antigravity, and GitHub Copilot.
- Visual node graph for selecting models and ordering fallback chains.
- Automatic fallback when a provider fails, rate-limits, or returns an error.
- Local request monitor with logs, request history, token usage, latency, and fallback details.
- Automatic Codex config sync using the stable provider key
rcodex. - Thread migration helper for existing Codex conversations.
- Update gate on
rcodex: if a newer npm version exists, rcodex asks the user to approve the global update before launching.
Requirements
- Node.js 20 or newer.
- Codex CLI or Codex desktop app installed.
- Provider credentials for the services you want to use.
Installation
npm install -g @kevin0181/rcodexThen launch rcodex:
rcodexThe first launch starts the gateway, updates ~/.codex/config.toml, launches Codex, and opens the gateway UI. The default gateway port is 3141; if that port is busy, rcodex picks the next free port and updates Codex config automatically.
Updates
When users run rcodex, the CLI checks the latest published npm version. If a newer version is available, rcodex prompts:
rcodex 0.0.2 is available (installed: 0.0.1). Update now? [y/N]If the user accepts, rcodex runs:
npm install -g @kevin0181/rcodex@latestAfter the update completes, run rcodex again. If the user declines, rcodex exits instead of launching the older version. If the npm registry cannot be reached, rcodex allows the installed version to run so offline users are not blocked.
Gateway UI
Open the UI at the URL printed by rcodex, usually:
http://localhost:3141Use the sidebar to add accounts and model slots. Drag model slots onto the canvas, connect them from the Out node, and order multiple slots to create fallback chains.
Supported account types:
- Claude with Anthropic API key or Claude Code OAuth.
- OpenAI API key, OAuth flow, or unofficial ChatGPT session token.
- Google Gemini API key.
- Antigravity OAuth, using Gemini / Cloud Code routing.
- GitHub Copilot OAuth device login.
- Ollama local endpoint, defaulting to
http://localhost:11434.
Commands
| Command | Description |
| --- | --- |
| rcodex | Start/restart the gateway, sync Codex config, launch Codex, and open the UI |
| rcodex setup | Run first-time setup in foreground mode |
| rcodex stop | Stop the background gateway |
| rcodex gateway | Switch Codex config to rcodex gateway mode |
| rcodex openai | Switch Codex config back to native OpenAI |
| rcodex doctor | Check installation, gateway status, and provider setup |
| rcodex sync | Re-register the gateway in Codex config and migrate threads |
| rcodex migrate | Migrate existing Codex threads to the rcodex provider |
Provider Notes
Claude
rcodex supports Anthropic API-key accounts and Claude Code OAuth. Older unofficial Claude.ai session auth is not supported for direct inference, so the UI does not offer it.
Ollama
Start Ollama before adding an Ollama account:
ollama servercodex discovers local models from http://localhost:11434/v1/models.
GitHub Copilot
Copilot uses GitHub device-code OAuth. After approval, rcodex stores the GitHub OAuth token locally and exchanges it for short-lived Copilot API tokens when requests are sent.
Antigravity
Antigravity OAuth uses the Google Cloud Code Assist compatible flow. rcodex includes a public desktop OAuth client fallback so login works after npm install. You can override it with your own Google OAuth client at:
~/.rcodex/antigravity-app.jsonRun rcodex doctor to diagnose supported setup issues.
Data and Privacy
- Gateway config is stored at
~/.rcodex/gateway.json. - Request history is stored at
~/.rcodex/requests.jsonl. - Gateway logs are stored at
~/.rcodex/gateway.log. - API keys and OAuth tokens stay local and are only sent to their corresponding provider APIs.
Gateway Config
Advanced rcodex options live in ~/.rcodex/gateway.json. Large codebase/tool-result turns can increase the local request body limit:
{
"bodyLimitMiB": 128
}The default is 64. Values are clamped to 1-1024 MiB.
Publishing
npm is the distribution channel for the rcodex command. GitHub Releases are useful for release notes and source archives, but users receive updates from npm because they install the package with npm install -g @kevin0181/rcodex.
For the current release:
npm login
npm run build
git tag v0.0.16
git push origin main --tags
npm publish --access publicThen create a GitHub Release from the pushed version tag and paste the release notes. For later versions:
npm version patch
git push origin main --tags
npm publish --access publicUse npm version minor or npm version major when the change is larger than a patch release.
Development
git clone https://github.com/neneee0181/rcodex.git
cd rcodex
npm install
npm run dev
npm run buildThere is no automated test script yet; use npm run build as the baseline verification.
License
MIT
