npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

buliangrenai.com

v1.3.14

Published

Cross-platform interactive CLI to configure Codex and Claude for Buliangren AI/NewAPI gateways.

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.4gpt-5.5claude-sonnet-5claude-opus-4-8claude-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 doctor

doctor 会输出当前系统、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-run

macOS 说明

macOS 下默认写入位置:

  • Codex:~/.codex/config.toml
  • Codex:~/.codex/auth.json
  • Claude:~/.claude/settings.json
  • 本工具登录会话:~/.buliangrenai/session.json

如果你设置了环境变量,会优先使用:

  • CODEX_HOME
  • CLAUDE_CONFIG_DIR
  • BULIANGRENAI_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 阶段做任何自动写入,必须用户主动运行命令。