Codex Docs 安装和构建
English

安装和构建

系统要求

要求 详细信息
操作系统 macOS 12+、Ubuntu 20.04+/Debian 10+ 或 Windows 11 通过 WSL2
Git(可选,推荐) 2.23+ 版本用于内置的 PR 助手
RAM 最低 4 GB(推荐 8 GB)

DotSlash

GitHub Release 还包含一个名为 codex 的 Codex CLI DotSlash 文件。使用 DotSlash 文件可以轻量级地提交到源代码控制,确保所有贡献者使用相同版本的可执行文件,无论他们使用什么平台进行开发。

从源代码构建

# 克隆仓库并导航到 Cargo 工作区的根目录。
git clone https://github.com/openai/codex.git
cd codex/codex-rs

# 如有必要,安装 Rust 工具链。
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup component add rustfmt
rustup component add clippy

# 构建 Codex。
cargo build

# 使用示例提示启动 TUI。
cargo run --bin codex -- "向我解释这个代码库"

# 进行更改后,确保代码干净。
cargo fmt -- --config imports_granularity=Item
cargo clippy --tests

# 运行测试。
cargo test