🔥 OpenAI Codex CLI:轻量级终端编程代理
英文标题:🔥 openai/codex
OpenAI 发布了 Codex CLI,一个可在本地终端运行的轻量级编程代理,支持 macOS、Linux 和 Windows。用户可通过 curl、npm 或 Homebrew 快速安装,并使用自己的 ChatGPT Plus、Pro、Business、Edu 或 Enterprise 账户直接登录使用,无需单独申请 API 密钥。该工具将 AI 编码辅助延伸到命令行环境,为开发者提供了更便捷的集成路径。项目基于 Apache-2.0 协议开源,有利于自定义和扩展。
818.5 KB
43.2 KB
中文
Codex CLI 是 OpenAI 推出的一款在本地计算机上运行的编码代理。
如果你想要在代码编辑器(VS Code、Cursor、Windsurf)中使用 Codex,请在你的 IDE 中安装。
如果你想要桌面应用体验,请运行 codex app 或访问 Codex App 页面。
如果你在寻找 OpenAI 的 云端代理 Codex Web,请前往 chatgpt.com/codex。
安装和运行 Codex CLI
在 macOS 或 Linux 上运行以下命令来安装 Codex CLI:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
在 Windows 上运行以下命令来安装 Codex CLI:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
Codex CLI 还可以通过以下包管理器安装:
# 使用 npm 安装
npm install -g @openai/codex
# 使用 Homebrew 安装
brew install --cask codex
然后只需运行 codex 即可开始使用。
你也可以前往最新的 GitHub 发布页面,下载适合你平台的二进制文件。
每个 GitHub 发布包含多个可执行文件,但通常你可能需要以下其中一个:
- macOS
- Apple Silicon/arm64:
codex-aarch64-apple-darwin.tar.gz - x86_64(较旧的 Mac 硬件):
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:
每个压缩包内包含一个嵌入了平台名称的条目(例如 codex-x86_64-unknown-linux-musl),因此你通常需要将其解压后重命名为 codex。
将 Codex 与你的 ChatGPT 计划结合使用
运行 codex 并选择使用 ChatGPT 登录。我们建议登录你的 ChatGPT 账户,以便作为 Plus、Pro、Business、Edu 或 Enterprise 计划的一部分使用 Codex。了解 ChatGPT 计划中包含了哪些内容。
你也可以使用 API 密钥来使用 Codex,但这需要额外设置。
本仓库基于 Apache-2.0 许可 授权。
English / 原文
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.
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"
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.
This repository is licensed under the Apache-2.0 License.
