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

@bumocc/codesw

v0.1.4

Published

Switch model providers for Claude Code / OpenCode / OpenClaw / Hermes Agent

Readme

codesw

在多个 Code 客户端之间一键切换模型供应商的 CLI 工具。

原理是写入各客户端自己的配置文件(~/.claude/settings.json~/.config/opencode/opencode.json 等),不做任何代理或中转。

支持的客户端

| 客户端 | 配置文件 | | ---------------------------------------------------------- | ------------------------------------------ | | Claude Code | ~/.claude/settings.json | | OpenCode | ~/.config/opencode/opencode.json | | OpenClaw | ~/.openclaw/openclaw.json | | Hermes Agent | ~/.hermes/config.yaml + ~/.hermes/.env |

支持的供应商

| id | 名称 | 默认模型 | | ------------------- | -------------------------------- | ---------------------- | | bumo-cc | 不墨 API | glm/glm-5.1 | | bumo-ai | BUMO API | claude-sonnet-4-6 | | zhipu | 智谱 AI (GLM) | glm-5.1 | | zhipu-coding | 智谱 AI Coding Plan | glm-5.1 | | bailian | 百炼 API | glm-5.1 | | bailian-coding | 百炼 Coding Plan | glm-5 | | volcengine | 火山方舟 API | doubao-seed-2.0-code | | volcengine-coding | 火山方舟 Coding Plan | kimi-k2.5 | | minimax | MiniMax | MiniMax-M2 | | kimi | Kimi API | kimi-k2.6 | | kimi-coding | Kimi Coding Plan | kimi-for-coding |

每家供应商同时支持 Anthropic 兼容和 OpenAI 兼容协议端点,codesw 会按客户端所需自动选择。

安装

npm i -g @bumocc/codesw
# 或
yarn global add @bumocc/codesw

从源码安装:

git clone [email protected]:bumocc/codesw.git
cd codesw
yarn install
yarn build
npm link

使用

交互模式

codesw

会引导你:

  1. 选择 / 新建一个 profile(供应商 + API Key + 模型)
  2. 选择要应用到哪个 Code 客户端

命令行

codesw list                      # 列出所有 profile
codesw add                       # 交互式添加 profile
codesw use <profile>             # 交互选择客户端后应用
codesw use <profile> <client>    # 直接应用到指定客户端
codesw show <profile>            # 查看 profile(API Key 脱敏)
codesw remove <profile>          # 删除 profile
codesw help                      # 帮助

示例:

codesw add                              # 新建一个叫 "my-glm" 的 profile
codesw use my-glm claude-code           # 应用到 Claude Code
codesw use my-glm opencode              # 同一个 profile 也可应用到 OpenCode

Profile 存储

Profile 保存在 ~/.codesw/profiles.json(权限 0600),包含 API Key、选择的模型等。codesw 自己维护这份数据,每次 use 时同步到目标客户端的配置文件。

{
  "profiles": {
    "my-glm": {
      "name": "my-glm",
      "provider": "zhipu",
      "apiKey": "...",
      "model": "glm-4.6"
    }
  },
  "active": {
    "claude-code": "my-glm"
  }
}

环境变量

  • NO_COLOR=1:关闭彩色输出

跨平台

Linux / macOS / Windows 均支持。Windows 上通过 npm 安装时会自动生成 codesw.cmd

许可证

MIT