
Codex CLI
CLIOpenAI 官方在本地运行的编码 Agent,Rust 实现,可读写代码、执行命令并在系统沙箱中运行;可用 ChatGPT 订阅登录,也可配置 API Key。
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.
Quickstart
Installing and running Codex CLI
Run the following on Mac or Linux to install Codex CLI:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
Run the following on Windows to install Codex CLI:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
The standalone installers download from https://releases.openai.com/codex by default and fall back to GitHub Releases if a metadata or asset download is unavailable. To force GitHub Releases, set CODEX_INSTALLER_USE_RELEASES_OPENAI_COM to false (0 and no are also accepted):
curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh
$env:CODEX_INSTALLER_USE_RELEASES_OPENAI_COM='false'; 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 codex
Then 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.
Using Codex with your ChatGPT plan
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.
Docs
This repository is licensed under the Apache-2.0 License.
相關資源

RTK (Rust Token Killer)
CLI在命令输出进入 agent 上下文之前做过滤和压缩的 Rust 命令行代理,覆盖 git、测试、grep、ls 等上百种命令,最多可减少约 90% 的 bash 输出;通过钩子自动改写 Claude Code、Codex 等 agent 执行的命令。
rtk-ai/rtk83.6k
ripgrep
CLI按正则递归搜索目录内容的高速文本搜索工具(命令名 rg),默认遵守 .gitignore 并自动跳过隐藏文件与二进制文件,支持按文件类型过滤,是编码 agent 检索代码库的常用命令。
BurntSushi/ripgrep69.2k
sd
CLI更直观的查找替换工具(sed 替代):使用 JavaScript / Python 风格的正则语法,支持字符串字面量模式与原地修改文件,适合 agent 批量改写文本。
chmln/sd7.4k
fd
CLI简单快速的 find 替代品:语法直观,支持正则与 glob 匹配,默认忽略隐藏文件和 .gitignore 中的路径,还能对搜索结果并行执行命令,适合 agent 快速定位文件。
sharkdp/fd44.8k
herdr
CLI为编码 agent 设计的终端复用器:分屏运行 Claude Code、Codex 等,标记每个窗格工作中、阻塞或空闲,断开连接后会话继续运行;agent 也能通过 CLI 创建窗格、互相发消息。
herdrdev/herdr44.4k
just
CLI用 justfile 保存并运行项目命令的命令运行器,语法受 make 启发但更简单;agent 可用 just --list 发现项目约定的构建、测试、部署命令并直接执行。
casey/just36.3k