Codex CLI
openai / codex
OpenAI 的本地 coding agent:Rust 实现、OS 级沙箱、MCP 与云任务交接,适合终端里改代码。OpenAI’s local coding agent: Rust binary, OS-level sandbox, MCP and cloud-task handoff, built for editing code in the terminal.
为什么选Why choose it
- 本地跑,默认在 OS 沙箱里执行命令;比“把 shell 全开给 agent”更适合日常开发。OS-level sandboxing limits what a command can touch.
- MCP、skills、IDE 与云端 Codex 能接起来;同一套任务可在本地或云端继续。MCP support lets it use external tools without custom glue.
- Apache-2.0、Rust 单二进制,安装和升级都轻;适合把 coding agent 当日常工具而不是玩具。Cloud-task handoff covers work that outgrows a terminal session.
不适合Not for
对 OpenAI 模型与账号体系最顺;换其他 provider 的能力与体验不保证对齐。You need a GUI-first coding assistant.
不是通用个人助理;文件、日程、聊天渠道这些事它不做。You cannot grant a terminal agent filesystem access.
最小上手Minimum setup
- 用 npm / brew 装 Codex CLI,登录或配 API key,先在一个测试仓库跑只读任务。Run it in a disposable repo with the sandbox enabled.
- 检查沙箱与审批设置,确认它能写哪些目录、能不能执行网络命令。Ask for a one-file change and inspect the diff.
- 跑一个“改代码 + 跑测试”的小任务,观察 diff、测试输出与云任务交接。Test a command that should be blocked and confirm the sandbox stops it.
依赖与成本Dependencies and cost
Node.js / npm 或 brew;OpenAI 账号或 API key;git;可选 MCP server。Check runtime, model weights and external service dependencies in the README.
许可与使用边界License and usage boundaries
代码 Apache-2.0;模型服务与云任务按 OpenAI 条款计费。Code is Apache-2.0; model weights, training data and generated content may have separate terms — check each before commercial use.
开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.
替代与相邻Alternatives and neighbors
- OpenCode — 生产可用Production,终端里的开源 coding agent:build / plan 双 agent、LSP 反馈、75+ 模型提供商,另有桌面 beta。An open-source coding agent in the terminal: separate build and plan agents, LSP feedback, 75+ model providers and a desktop beta.
- OpenHands — 生产可用Production,能读代码、改代码、跑命令的软件工程 agent,提供 CLI、Web 界面与沙箱运行时,可接本地或云端模型。A software-engineering agent that can read code, edit it and run commands, with CLI, web UI and a sandboxed runtime.
- OpenAI Agents SDK — 先试这个Start here,轻量的 agent 运行时:agent、handoff、guardrail、trace 四个核心概念。A lightweight agent runtime with four core ideas: agents, handoffs, guardrails and traces.
下一步Next steps
- 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
- 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
- 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.
GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare