Windows系统安装codex cli

Windows系统安装codex cli

2.1打开终端

window+x

powershell

终端 / Windows Terminal(Win11 默认有)

s1 安装 Node.js (LTS)

winget install -e --id OpenJS.NodeJS.LTS

s2 验证安装(重启终端)

node -v

npm -v

s3 镜像源配置(或者魔法)
复制代码
npm config set registry https://registry.npmmirror.com
npm config get registry   # 验证,应显示上述地址
s4 安装codex

npm install -g @openai/codex

s5 创建配置目录并配置

mkdir $env:USERPROFILE\.codex -Force

config.toml (填写代理地址 和 模型信息)

复制代码
@"
model = "gpt-5.3-codex"
model_provider = "mirror"

[model_providers.mirror]
name = "mirror"
base_url = "https://gpt.tool2ai.com/codex"(需要修改)
wire_api = "responses"
requires_openai_auth = true
"@ | Out-File -FilePath $env:USERPROFILE\.codex\config.toml -Encoding ASCII

auth.json(配置api key)

复制代码
@"
{
  "OPENAI_API_KEY": "your-actual-token-here"(修改)
}
"@ | Out-File -FilePath $env:USERPROFILE\.codex\auth.json -Encoding ASCII

进入

env:USERPROFILE\.codex

C:\Users\24408\.codex

中进行修改

如果系统不让允许脚本

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

相关推荐
阿里云大数据AI技术2 小时前
构建高转化海外电商搜索:阿里云OpenSearch行业算法版的全链路智能优化策略实战
人工智能·搜索引擎
Awu12272 小时前
⚡从零开发 Agent CLI(五)实现一个可治理、可扩展的工具系统
前端·人工智能·claude
字节跳动视频云技术团队2 小时前
让 Agent 成为音视频工作台:AI MediaKit CLI + Skill 发布
人工智能·音视频开发
魏祖潇2 小时前
framework 整合实战——DDD/TDD/SDD 三件套在 framework 仓的真实落地
人工智能·后端
Token炼金师3 小时前
去噪扩散:从随机噪声到高保真图像的数学之路
人工智能·aigc
这个DBA有点耶3 小时前
AI写的SQL跑崩了生产库,这锅谁背?
数据库·人工智能·程序员
阿里云大数据AI技术3 小时前
阿里云 EMR AI 助手正式发布:从问答工具到全栈智能运维助手
运维·人工智能
Larcher4 小时前
从零搭建 MCP 服务——让 AI 拥有无限扩展能力
人工智能·程序员
zzzzzz3104 小时前
你的 AI 写的 React 烂透了?这个 8000+ Star 的开源工具能揪出 90% 的「Agent 屎山」
人工智能
小星AI4 小时前
MCP协议超详细教程,从入门到实战
人工智能