Codex CLI is a coding agent from OpenAI that runs locally on your computer.
If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE.
If you want the desktop app experience, run
codex app or visit the Codex App page.
If you are looking for the cloud-based agent from OpenAI, Codex Web, go to chatgpt.com/codex.
This fork adds native DeepSeek integration and third-party model provider support to Codex CLI. Use DeepSeek V4, Moon Bridge, LiteLLM, Ollama, LM Studio, or any OpenAI Responses API-compatible endpoint.
Run the following on Mac or Linux to install Codex CLI:
curl -fsSL https://chatgpt.com/codex/install.sh | shRun the following on Windows to install Codex CLI:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
Codex CLI can also be installed via the following package managers:
# Install using npm
npm install -g @openai/codex# Install using Homebrew
brew install --cask codexThen simply run codex to get started.
You can also go to the latest GitHub Release and download the appropriate binary for your platform.
Each GitHub Release contains many executables, but in practice, you likely want one of these:
- macOS
- Apple Silicon/arm64:
codex-aarch64-apple-darwin.tar.gz - x86_64 (older Mac hardware):
codex-x86_64-apple-darwin.tar.gz
- Apple Silicon/arm64:
- Linux
- x86_64:
codex-x86_64-unknown-linux-musl.tar.gz - arm64:
codex-aarch64-unknown-linux-musl.tar.gz
- x86_64:
Each archive contains a single entry with the platform baked into the name (e.g., codex-x86_64-unknown-linux-musl), so you likely want to rename it to codex after extracting it.
Run codex and select Sign in with ChatGPT. We recommend signing into your ChatGPT account to use Codex as part of your Plus, Pro, Business, Edu, or Enterprise plan. Learn more about what's included in your ChatGPT plan.
You can also use Codex with an API key, but this requires additional setup.
This fork adds a role system: switch Codex from a coding agent to a writer, researcher, or any persona you define — while keeping its tools, sandboxing, and approval rules intact.
/role # pick writer / researcher / default, or your own
Add custom roles as markdown files under ~/.codex/roles/<name>.md, set a default with role = "writer" in config.toml, or bundle a role with a model in a profile. See the roles guide.
This fork ships a built-in codex-deepseek-proxy that translates OpenAI Responses API ↔ DeepSeek Chat Completions in-process — zero extra dependencies, no sidecar process to manage.
-
Get a DeepSeek API key from platform.deepseek.com.
-
Write config (
~/.codex/config.toml):
model = "deepseek-v4-pro" # or deepseek-v4-flash
model_provider = "deepseek"
model_catalog_json = "~/.codex/models_catalog.json"- Copy the models catalog (from this repo):
cp codex-rs/deepseek-proxy/examples/models_catalog.json \
~/.codex/models_catalog.json- Run:
export DEEPSEEK_API_KEY=sk-...
codexCodex auto-spawns the proxy on 127.0.0.1:38440. Look for INFO auto-spawned codex-deepseek-proxy on stderr.
| Feature | Status |
|---|---|
| Text streaming (SSE) | ✅ |
| Tool calling (concurrent) | ✅ |
| Reasoning (thinking) stream | ✅ |
| Usage / token counting | ✅ |
| Multi-modal (image input) | ⏳ |
| Structured output (json_schema) | ⏳ |
You can also use Moon Bridge (DeepSeek official) or LiteLLM Proxy if you prefer an external gateway. See codex-rs/docs/deepseek.md for full instructions.
Configure any OpenAI Responses API-compatible endpoint in ~/.codex/config.toml:
model = "your-model-id"
model_provider = "my-provider"
[model_providers.my-provider]
name = "My Provider"
base_url = "https://your-gateway.example.com/v1"
env_key = "MY_API_KEY"
wire_api = "responses"Built-in providers: OpenAI, Ollama (localhost:11434), LM Studio (localhost:1234).
See codex-rs/docs/model-providers.md for the full reference.
git clone https://github.com/caolongcl/dscodex.git
cd dscodex
# Quick install (debug build → ~/.local/bin/codex)
scripts/build-and-install-local.sh
# Release build
scripts/build-and-install-local.sh --releaseSee docs/install.md for detailed build prerequisites and platform-specific notes.
- Codex Documentation
- Roles guide
- DeepSeek integration guide
- Third-party model providers
- Contributing
- Installing & building
- Open source fund
This repository is licensed under the Apache-2.0 License.
