Package Exports
- buliangrenai.com/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (buliangrenai.com) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
buliangrenai.com
交互式配置 Codex / Claude 的 NewAPI 网关 CLI,支持 Windows、macOS、Linux。
发布到 npm 后,用户可以直接运行:
npx -y buliangrenai.com默认会打开交互式主菜单,可直接选择:
- 配置 Codex / Claude
- 登录 / 切换网站账号
- 退出网站登录 / 清除本地会话
- 查看账号、余额、订阅
- 管理 API 密钥
- 检查配置、恢复备份
登录 buliangrenai.com 网站账号是可选的:未登录也可以直接进入配置流程,Base URL 默认使用本站地址,然后手动输入 API Key 完成配置。如果本机已经登录并且会话有效,配置 API 密钥时可以从已有密钥列表选择,也可以直接选择“创建新 API 密钥并用于本次配置”;创建密钥时会优先把 auto 分组作为默认推荐项。如需退出网站登录并不再显示密钥列表,可在主菜单选择“退出网站登录”或运行 npx -y buliangrenai.com logout。登录提示里可以一键打开网站,用于注册、充值或找回密码。配置默认模型时会使用下拉列表选择,内置 gpt-5.4、gpt-5.5、claude-sonnet-5、claude-opus-4-8、claude-fable-5,其中 Claude 默认使用 claude-sonnet-5;也可以选择“手动输入其他模型”。交互过程中可按 Esc 返回上一级菜单;在顶层菜单按 Esc 会退出。
说明:npm 包名是 buliangrenai.com,包内唯一可执行命令名是 buliangrenai。
这样 npx buliangrenai.com 仍会自动执行它,同时避免 Windows 把 .com 当作二进制可执行文件。
它会在当前 CMD / PowerShell / Terminal 里出现交互式配置界面,并自动备份、写入:
- Codex:
~/.codex/config.toml - Codex:
~/.codex/auth.json - Claude:
~/.claude/settings.json
Base URL 默认直接使用:
- Codex / OpenAI:
https://buliangrenai.com/v1 - Claude / Anthropic:
https://buliangrenai.com/
使用
macOS / Linux / Windows 都是同一个命令:
npx -y buliangrenai.com如果 npm 版本较老,也可以写成:
npx --yes buliangrenai.com@latest运行前请确认 Node.js 版本不低于 18:
node -v如果只想直接进入配置流程:
npx -y buliangrenai.com setup检查当前配置:
npx -y buliangrenai.com doctordoctor 会输出当前系统、CPU 架构、Node 版本、用户 Home 目录,以及 Codex / Claude / 本工具会话文件的实际路径,方便在 macOS 上确认配置写到了哪里。
登录网站账号并保存会话(可选,用于管理密钥、余额、订阅,或配置时从密钥列表选择):
npx -y buliangrenai.com login
npx -y buliangrenai.com logout如果需要在登录前打开网站:
npx -y buliangrenai.com然后在登录提示里选择“一键打开网站”。
查看余额、订阅和密钥:
npx -y buliangrenai.com balance
npx -y buliangrenai.com subs
npx -y buliangrenai.com keys list
npx -y buliangrenai.com keys create --name "my key"
npx -y buliangrenai.com keys show <id> --full
npx -y buliangrenai.com keys delete <id>恢复备份:
npx -y buliangrenai.com rollback非交互示例:
npx -y buliangrenai.com --all \
--base-url https://buliangrenai.com/v1 \
--claude-base-url https://buliangrenai.com/ \
--api-key sk-xxxx \
--model gpt-5.4 \
--claude-model claude-sonnet-5 \
-y本地开发
npm install
npm start
npm run doctor
npm run test:syntax
npm publish --dry-runmacOS 说明
macOS 下默认写入位置:
- Codex:
~/.codex/config.toml - Codex:
~/.codex/auth.json - Claude:
~/.claude/settings.json - 本工具登录会话:
~/.buliangrenai/session.json
如果你设置了环境变量,会优先使用:
CODEX_HOMECLAUDE_CONFIG_DIRBULIANGRENAI_SITE_URL
如果 macOS 上 npx 运行的不是最新版本,可以清理 npm 缓存后重试:
npm cache clean --force
npx --yes buliangrenai.com@latest doctor发布
确保已登录 npm:
npm whoami发布:
npm publish如果只是测试发布内容:
npm publish --dry-run安全说明
- 写入前会自动备份原配置文件。
- CLI 不会明文打印 API Key。
- 不会修改
~/.claude.json,只修改~/.claude/settings.json。 - 不会在
postinstall阶段做任何自动写入,必须用户主动运行命令。