npm install -g @openai/codex
# powershell中 设置你的 API Key
$env:OPENAI_API_KEY = "sk-..."
$env:OPENAI_BASE_URL = "https://yunwu.ai/v1"
# cmd 中 设置你的 API Key
set OPENAI_API_KEY=sk-....
set OPENAI_BASE_URL=https://yunwu.ai/v1
codex
codex --model gpt-4o "Explain this repo to me"
codex --model gpt-4o --full-auto "为这个项目添加深色模式"
codex-main
文件夹内新建 start.ps1
:# start.ps1
$env:OPENAI_API_KEY = "sk-..."
$env:OPENAI_BASE_URL = "https://yunwu.ai/v1"
codex --model gpt-4o
💡 提示: 这里为了省钱,只使用 gpt-4o,具体模型可自行修改
start.ps1
,就能进入 Codex CLI 会话。