Codex使用

1 安装Codex CLI

npm install -g @openai/codex 

image

安装后,运行codex命令 

image

网络原因,无法注册OpenAI账号,所以关掉即可。

 

2 安装CC Switch

https://ccswitch.io/zh/download 

image 

image

 

3 配置和使用

安装成功后,切换到codex,然后添加供应商 

image

选择百炼(需要申请一个api key)

https://bailian.console.aliyun.com/ 

image

然后填入api key,模型选一个有免费额度的。注意要开启路由 

image

添加成功: 

image

然后在设置中开启路由

image 

image

重新打开cmd终端,输入codex 

image

所有提问都选默认,然后再关掉重新打开,就可以正常使用了

image

posted @ 2026-10-12 16:18  后知后觉0107  阅读(11)  评论(0)    收藏  举报