
codex-manager-rust
A Codex CLI account manager with local gateway forwarding for managing multiple Codex accounts, usage tracking, and OpenAI-compatible API gateway
- Installs
- 254
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/codex-skills --skill codex-manager-rust- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads codex-manager-rust automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Codex Manager Skill
Skill by ara.so — Codex Skills collection.
Overview
Codex Manager is a Rust-based account pool manager and local gateway for Codex CLI. It provides:
- Account Pool Management: Import, organize, and track multiple Codex accounts with usage quotas
- Platform Key Management: Generate and manage API keys bound to specific models and inference levels
- Local Gateway: OpenAI-compatible API gateway for Codex CLI, Gemini CLI, Claude Code, and third-party tools
- Usage Tracking: Monitor 5-hour + 7-day windows, Code Review, Spark quotas, and reset times
- Plugin System: Extensible Rhai-based plugin architecture with built-in and custom markets
- Aggregation API: Manage third-party upstream forwarding for Codex/Claude classification
Installation
Desktop (Recommended)
Download the latest release for your platform:
- Windows:
codexmanager_<version>_x64_en-US.msi - macOS:
codexmanager_<version>_x64.dmgorcodexmanager_<version>_aarch64.dmg - Linux:
codexmanager_<version>_amd64.AppImageor.deb
Service Mode (Headless)
# Download service binaries
wget https://github.com/qxcnm/Codex-Manager/releases/latest/download/codexmanager-service
wget https://github.com/qxcnm/Codex-Manager/releases/latest/download/codexmanager-web
wget https://github.com/qxcnm/Codex-Manager/releases/latest/download/codexmanager-start
chmod +x codexmanager-*
# Start service + web
./codexmanager-start
Docker
docker pull qxcnm/codexmanager:latest
docker run -d \
-p 3000:3000 \
-p 8787:8787 \
-v ./data:/app/data \
-e CODEX_MANAGER_PORT=3000 \
-e CODEX_MANAGER_WEB_PORT=8787 \
qxcnm/codexmanager:latest
Configuration
Data Directory
Default database locations:
- Windows:
%APPDATA%\com.codexmanager.desktop\codexmanager.db - macOS:
~/Library/Application Support/com.codexmanager.desktop/codexmanager.db - Linux:
~/.local/share/com.codexmanager.desktop/codexmanager.db
Environment Variables
# Core settings
export CODEX_MANAGER_PORT=3000 # Service port
export CODEX_MANAGER_LISTEN=0.0.0.0 # Listen address
export CODEX_MANAGER_DATABASE_URL=sqlite:///path/to/codexmanager.db
# Proxy configuration
export CODEX_MANAGER_PROXY=http://127.0.0.1:7890
# Timeout settings
export CODEX_MANAGER_REQUEST_TIMEOUT=300 # Total request timeout (seconds)
export CODEX_MANAGER_STREAM_IDLE_TIMEOUT=60 # SSE idle timeout (seconds)
export CODEX_MANAGER_SSE_KEEPALIVE=15 # SSE keepalive interval (seconds)
# Web security
export CODEX_MANAGER_WEB_PASSWORD=your_secure_password
export CODEX_MANAGER_WEB_PORT=8787
# Concurrency
export CODEX_MANAGER_MAX_CONCURRENT_PER_ACCOUNT=3
Configuration File (config.toml)
[server]
port = 3000
listen = "0.0.0.0"
proxy = "http://127.0.0.1:7890"
[database]
url = "sqlite:///path/to/codexmanager.db"
[timeout]
request = 300
stream_idle = 60
sse_keepalive = 15
[concurrency]
max_per_account = 3
[web]
port = 8787
password = "your_secure_password"
Codex CLI Integration (ccswitch)
Setup auth.json
Create ~/.codex/auth.json:
{
"default_host": "http://127.0.0.1:3000",
"hosts": {
"http://127.0.0.1:3000": {
"access_token": "your-platform-key-from-codexmanager"
}
}
}
Setup config.toml
Create ~/.codex/config.toml:
[client]
host = "http://127.0.0.1:3000"
Verify Connection
# Test with ccswitch
ccswitch list
# Or direct curl
curl http://127.0.0.1:3000/v1/models \
-H "Authorization: Bearer your-platform-key"
Account Management
Import Accounts
Desktop: Navigate to "Account Management" → "Import Accounts"
API (for automation):
curl -X POST http://127.0.0.1:3000/api/accounts/import \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"accounts": [
{
"email": "user@example.com",
"access_token": "sess-...",
"session_token": "eyJhbGc...",
"group": "default",
"tags": ["prod", "high-quota"]
}
]
}'
Refresh Usage
# Refresh all accounts
curl -X POST http://127.0.0.1:3000/api/accounts/refresh-all \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
# Refresh specific account
curl -X POST http://127.0.0.1:3000/api/accounts/{account_id}/refresh \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
Export Accounts
# Export all accounts
curl http://127.0.0.1:3000/api/accounts/export \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-o accounts_export.json
# Export by group
curl "http://127.0.0.1:3000/api/accounts/export?group=production" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-o prod_accounts.json
Platform Key Management
Create Platform Key
curl -X POST http://127.0.0.1:3000/api/platform-keys \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"name": "production-key",
"key": "sk-custom-key-or-leave-empty-for-random",
"models": ["gpt-4", "claude-3-opus-20240229"],
"inference_level": "high",
"service_level": "fast",
"enabled": true
}'
List Platform Keys
curl http://127.0.0.1:3000/api/platform-keys \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
Bind Models
curl -X PATCH http://127.0.0.1:3000/api/platform-keys/{key_id} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"models": ["gpt-4o", "claude-3-5-sonnet-20241022"],
"inference_level": "medium"
}'
Gateway Usage
OpenAI-Compatible Endpoint
# Chat completions
curl http://127.0.0.1:3000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-platform-key" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Hello!"}
],
"stream": true
}'
# Image generation
curl http://127.0.0.1:3000/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-platform-key" \
-d '{
"model": "gpt-image-2",
"prompt": "A futuristic cityscape",
"n": 1,
"size": "1024x1024"
}'
Gemini Forwarding
# Gemini requests auto-forward to /v1/responses
curl http://127.0.0.1:3000/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-platform-key" \
-d '{
"model": "gemini-2.0-flash",
"messages": [
{"role": "user", "content": "Explain quantum computing"}
]
}'
With Tools/MCP
curl http://127.0.0.1:3000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-platform-key" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Generate an image of a sunset"}
],
"tools": [
{
"type": "function",
"function": {
"name": "image_generation",
"description": "Generate images",
"parameters": {
"type": "object",
"properties": {
"prompt": {"type": "string"}
}
}
}
}
]
}'
Model Management
Sync Models
# Sync from remote
curl -X POST http://127.0.0.1:3000/api/models/sync \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
# Export cache (desktop auto-syncs to ~/.codex/models_cache.json)
curl http://127.0.0.1:3000/api/models/export \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-o models_cache.json
Add Custom Model
curl -X POST http://127.0.0.1:3000/api/models \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"id": "custom-gpt-4",
"name": "Custom GPT-4",
"visibility": "public",
"supportedInApi": true,
"maxTokens": 8192
}'
Aggregation API
Add Upstream
curl -X POST http://127.0.0.1:3000/api/aggregation/upstreams \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"name": "VisionCoder",
"base_url": "https://api.visioncoder.cn/v1",
"api_key": "${VISIONCODER_API_KEY}",
"provider": "codex",
"priority": 1,
"enabled": true
}'
Test Upstream
curl -X POST http://127.0.0.1:3000/api/aggregation/upstreams/{id}/test \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
Plugin System
Plugin Directory Structure
plugins/
├── manifest.json # Plugin metadata
├── main.rhai # Entry point
├── tasks/ # Background tasks
└── ui/ # Optional UI components
Example Plugin (manifest.json)
{
"id": "account-auto-refresh",
"name": "Auto Refresh Accounts",
"version": "1.0.0",
"author": "Your Name",
"description": "Automatically refresh account usage every hour",
"entry": "main.rhai",
"permissions": ["accounts.read", "accounts.refresh"],
"tasks": [
{
"name": "refresh-task",
"schedule": "0 */1 * * *",
"script": "tasks/refresh.rhai"
}
]
}
Example Plugin (main.rhai)
// Access system API via Rhai built-ins
fn on_install() {
log_info("Plugin installed");
// Get all accounts
let accounts = system_call("accounts.list", #{});
log_info(`Found ${accounts.len()} accounts`);
}
fn on_enable() {
log_info("Plugin enabled");
}
fn on_task_run(task_name) {
if task_name == "refresh-task" {
let accounts = system_call("accounts.list", #{});
for account in accounts {
if account.enabled {
system_call("accounts.refresh", #{
id: account.id
});
log_info(`Refreshed account: ${account.email}`);
}
}
}
}
Install Plugin
# Via API
curl -X POST http://127.0.0.1:3000/api/plugins/install \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"source": "file:///path/to/plugin",
"market": "custom"
}'
Common Patterns
Account Rotation Strategy
// Rust service-side logic (for reference)
use codexmanager::{AccountPool, SelectionStrategy};
let pool = AccountPool::new(db).await?;
// Select by lowest usage
let account = pool.select_account(SelectionStrategy::LowestUsage {
model: "gpt-4o",
inference_level: "high",
}).await?;
// Select by round-robin
let account = pool.select_account(SelectionStrategy::RoundRobin {
group: "production",
}).await?;
Rate Limiting
# Set per-account concurrency
curl -X PATCH http://127.0.0.1:3000/api/settings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"max_concurrent_per_account": 2,
"enable_conservative_backoff": true
}'
Health Check
# Check service health
curl http://127.0.0.1:3000/health
# Check account pool status
curl http://127.0.0.1:3000/api/accounts/stats \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
Troubleshooting
Service Won't Start
# Check port availability
netstat -an | grep 3000
# Check logs (desktop)
# Windows: %APPDATA%\com.codexmanager.desktop\logs
# macOS: ~/Library/Logs/com.codexmanager.desktop
# Linux: ~/.local/share/com.codexmanager.desktop/logs
# Check logs (service)
./codexmanager-service --log-level debug
Accounts Not Matching
# Check account hit rules
curl http://127.0.0.1:3000/api/accounts/debug-match \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}" \
-d '{
"model": "gpt-4o",
"inference_level": "high"
}'
Challenge Interception
If accounts are flagged with challenge/captcha:
- Check proxy configuration:
CODEX_MANAGER_PROXY - Reduce concurrency:
max_concurrent_per_account - Enable conservative backoff in settings
- Manually re-authorize affected accounts via browser
Model Cache Not Syncing
# Force sync to ~/.codex/models_cache.json
curl -X POST http://127.0.0.1:3000/api/models/sync-local \
-H "Authorization: Bearer ${CODEX_MANAGER_API_KEY}"
# Verify cache location
cat ~/.codex/models_cache.json
macOS Gatekeeper Block
# Allow unsigned app
xattr -dr com.apple.quarantine /Applications/codexmanager.app
# Or use System Preferences → Security & Privacy → Allow
Database Locked
# Stop all instances
pkill codexmanager
# Remove lock file (if exists)
rm ~/.local/share/com.codexmanager.desktop/codexmanager.db-wal
rm ~/.local/share/com.codexmanager.desktop/codexmanager.db-shm
# Restart service
./codexmanager-start
Additional Resources
FAQ
What does the codex-manager-rust skill do?
A Codex CLI account manager with local gateway forwarding for managing multiple Codex accounts, usage tracking, and OpenAI-compatible API gateway
How do I install codex-manager-rust?
Run npx skills add https://github.com/reason-machines/codex-skills --skill codex-manager-rust in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codex-manager-rust/ (personal) or .claude/skills/codex-manager-rust/ (project).
Which AI agents can use codex-manager-rust?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is codex-manager-rust safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains codex-manager-rust?
It is published by reason-machines in reason-machines/codex-skills. It has 254 recorded installs.
More from reason-machines/codex-skills
academic-research-skills-codex
reason-machines/codex-skills
AI-assisted academic research workflows for literature review, paper writing, peer review, and research pipelines
codexplusplus-launcher
reason-machines/codex-skills
Enhanced launcher for Codex App that unlocks plugins, enables session deletion, exports conversations, and syncs provider sessions via CDP injection
codex-plugin-claude-code
reason-machines/codex-skills
Use OpenAI Codex from inside Claude Code for code reviews, adversarial reviews, and delegating tasks to Codex as a subagent.
codex-plusplus-tweak-system
reason-machines/codex-skills
Expert in developing, installing, and managing tweaks for the Codex++ desktop app extension system
awesome-codex-skills-curator
reason-machines/codex-skills
Curate, install, and manage Codex skills from the awesome-codex-skills collection for AI coding agents.
awesome-codex-subagents
reason-machines/codex-skills
A curated collection of 136+ specialized Codex subagents for development tasks across 10 categories
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.