CodeX 配置¶
企业级 AI 编程助手,GPT-5 驱动。
Windows 完整安装教程:¶
第一步:安装Node.js¶
方法一:使用官方安装包(推荐)
-
下载 LTS 版本的 Windows Installer (.msi)
-
运行安装程序,按默认设置完成安装
-
安装程序会自动添加到 PATH 环境变量
方法二:使用包管理器
使用 Winget(Windows 11 或 Windows 10 自带):
使用 Chocolatey:
使用 Scoop:
验证安装:
提示: 建议使用 LTS(长期支持)版本以获得最佳稳定性。安装完成后需重启命令行窗口。
第二步:安装 CodeX CLI¶
打开命令提示符(管理员)或 PowerShell:
验证安装:
第三步:获取 API 令牌¶
-
点击「添加令牌」
-
令牌名称:随意填写(如 "Codex")
-
额度建议:设置为无限额度
-
其他选项保持默认
-
点击确认,复制生成的令牌
第四步:创建配置文件¶
-
按
Win + R,输入%USERPROFILE%回车 -
创建
.codex文件夹 -
在文件夹内创建以下两个文件:
config.toml 文件:
model_provider = "favorapi"
model = "gpt-5.5"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true
[model_providers.favorapi]
name = "favorapi"
base_url = "https://api.rutaceae.com/v1"
wire_api = "responses"
requires_openai_auth = true
auth.json 文件:
重要: 将
sk-xxxxxxxxxxxxxxxx替换为您的令牌!
第五步:启动 CodeX
首次运行配置:
-
选择您的开发环境配置
-
配置代码生成偏好
-
设置推理等级
-
开始 AI 辅助编程!🚀
macOS 完整安装教程¶
第一步:安装 Node.js¶
第二步:安装 CodeX CLI¶
第三步:获取 API 令牌¶
-
点击「添加令牌」
-
令牌名称:随意填写(如 "Codex")
-
额度建议:设置为无限额度
-
其他选项保持默认
-
点击确认,复制生成的令牌
第四步:创建配置文件¶
# 创建配置目录
mkdir -p ~/.codex
cd ~/.codex
# 创建 config.toml
cat > config.toml << 'EOF'
model_provider = "favorapi"
model = "gpt-5.5"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true
[model_providers.favorapi]
name = "favorapi"
base_url = "https://api.rutaceae.com/v1"
wire_api = "responses"
requires_openai_auth = true
EOF
# 创建 auth.json
cat > auth.json << 'EOF'
{
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
}
EOF
编辑 auth.json,替换为您的令牌:
nano ~/.codex/auth.json
第五步:启动 CodeX¶
Linux 完整安装教程¶
第一步:安装 Node.js¶
Ubuntu / Debian:
# 更新软件包列表
sudo apt update
# 方法一:使用官方仓库
sudo apt install -y nodejs npm
# 方法二:使用 NodeSource(获取最新版本,推荐)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
CentOS / RHEL / Fedora:
Arch Linux:
验证安装:
第二步:安装 CodeX CLI¶
第三步:获取 API 令牌¶
-
点击「添加令牌」
-
令牌名称:随意填写(如 "Codex")
-
额度建议:设置为无限额度
-
其他选项保持默认
-
点击确认,复制生成的令牌
第四步:创建配置文件
# 创建配置目录
mkdir -p ~/.codex
# 创建 config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "favorapi"
model = "gpt-5.5"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true
[model_providers.favorapi]
name = "favorapi"
base_url = "https://api.rutaceae.com/v1"
wire_api = "responses"
requires_openai_auth = true
EOF
# 创建 auth.json
cat > ~/.codex/auth.json << 'EOF'
{
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
}
EOF
编辑替换令牌:
nano ~/.codex/auth.json
第五步:启动 CodeX
VSCode 插件配置¶
适用于所有平台(Windows / macOS / Linux)
配置步骤:
-
确保已安装 ChatGPT/CodeX 相关的 VSCode 扩展插件
-
打开 VSCode 的
settings.json文件-
Windows:
Ctrl + Shift + P→ 输入 "Preferences: Open Settings (JSON)" -
macOS:
Cmd + Shift + P→ 输入 "Preferences: Open Settings (JSON)"
-
-
添加以下配置:
{
"chatgpt.apiBase": "https://api.rutaceae.com/v1",
"chatgpt.config": {
"preferred_auth_method": "apikey",
"apiKey": "sk-xxxxxxxxxxxxxxxx"
}
}
⚠️将
sk-xxxxxxxxxxxxxxxx替换为您的令牌配置完成后重启 VSCode 以确保设置生效