supercc
v0.1.1
Published
One-click Codex environment setup for NewAPI-compatible channels
Maintainers
Readme
NewAPI Codex Env Installer
这是一个面向 NewAPI 兼容渠道的 Codex 环境一键配置工具。
当前 npm 包名:supercc
当前命令名:supercc
现在的逻辑
当前版本采用完整的 Codex 配置流程:
- 检查 Node.js / npm / Codex CLI
- 缺失时尝试自动安装
@openai/codex - 使用
/v1/models校验Base URL + API Key - 直接写
~/.codex/config.toml - 直接写
~/.codex/auth.json - 覆盖前自动生成
.bak config.toml使用自定义 providerauth.json写入:
{
"OPENAI_API_KEY": "用户输入的 key"
}当前行为
核心参数化有三处:
base_url- 使用用户输入的
Base URL - 自动规范成
.../v1
- 使用用户输入的
provider- 默认使用
supercc - 也支持通过
--provider自定义
- 默认使用
model- 默认使用
gpt-5.4 - 若未显式指定模型,且默认模型不在
/v1/models返回列表中,会自动切到可用模型
- 默认使用
生成的 config.toml 结构
脚本会写成下面这种结构:
cli_auth_credentials_store = "file"
model_provider = "newapi"
model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"
[model_providers.supercc]
name = "supercc"
base_url = "https://your-newapi.example.com/v1"
wire_api = "responses"
requires_openai_auth = true
[features]
apps = false使用方式
cd installer/codex-env
node cli.js \
--api-key sk-your-newapi-key \
--base-url https://your-newapi.example.com发布到 npm 后可直接这样用:
npx supercc --api-key sk-your-newapi-key --base-url https://your-newapi.example.com可选指定模型:
node cli.js \
--api-key sk-your-newapi-key \
--base-url https://your-newapi.example.com \
--model gpt-5.4可选指定 provider 名:
node cli.js \
--api-key sk-your-newapi-key \
--base-url https://your-newapi.example.com \
--provider my_newapi可选跳过检查:
node cli.js \
--api-key sk-your-newapi-key \
--base-url https://your-newapi.example.com \
--skip-verify \
--skip-install当前定位
这版已经不再只是最小可用版,而是更接近完整分发工具:
- 当前
newapi渠道对 Codex 是否能直接跑通 base_url=/v1的兼容性是否正常- 用户本地的 Codex 配置是否能被这种方式稳定接管
- 用户机器上没装 Codex CLI 时,能否自动兜底安装
如果你后面确认这条路没问题,再往里加:
--restore回滚配置- Windows PowerShell 兼容增强
- 配置文件合并而非整文件覆盖
- 支持更多诊断和联网测试项
