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

easy-cc-api-switch

v1.0.0

Published

Claude Code API 配置快速切换工具,支持循环切换配置

Readme

Easy CC API Switch

Claude Code API 配置快速切换工具

这是 claude-config-switch 的增强版本,在原有功能基础上新增了快速循环切换功能。

✨ 新增功能

快速循环切换

使用 ccs nextccs n 命令可以快速切换到下一个 API 配置,无需交互确认。

# 切换到下一个配置
ccs next

# 或使用简写
ccs n

当切换到最后一个配置时,会自动循环回到第一个配置。

📦 安装

npm install -g easy-cc-api-switch

🚀 使用方法

1. 配置 API 列表

首先需要创建 API 配置文件:

ccs o api

这会打开 ~/.claude/apiConfigs.json 文件,按以下格式添加你的 API 配置:

[
  {
    "name": "官方API",
    "config": {
      "env": {
        "ANTHROPIC_AUTH_TOKEN": "sk-ant-xxx",
        "ANTHROPIC_BASE_URL": "https://api.anthropic.com",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
      },
      "permissions": {
        "allow": [],
        "deny": []
      }
    }
  },
  {
    "name": "代理API",
    "config": {
      "env": {
        "ANTHROPIC_AUTH_TOKEN": "your-proxy-token",
        "ANTHROPIC_BASE_URL": "https://your-proxy.com/api",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
      },
      "permissions": {
        "allow": [],
        "deny": []
      }
    }
  }
]

2. 切换配置

交互式选择(原有功能)

ccs ls
# 或
ccs list

会显示所有可用配置,通过上下键或输入序号选择。

快速循环切换(新功能)⭐

ccs next
# 或
ccs n

直接切换到下一个配置,无需确认。适合频繁切换场景。

3. 其他命令

# 查看帮助
ccs --help

# 打开 API 配置文件
ccs o api

# 打开 settings 配置文件
ccs o setting

# 检查 API 健康状态
ccs health

# 配置企微通知
ccs notify

# 查看版本
ccs -v

📋 配置文件说明

工具使用两个配置文件:

  • ~/.claude/apiConfigs.json - 存储所有可用的 API 配置列表
  • ~/.claude/settings.json - 当前激活的配置(由 Claude Code 使用)

切换配置时,工具会自动更新 settings.json,同时保留你的 hooks 等其他设置。

🔄 工作原理

  1. 交互式切换 (ccs ls):显示配置列表,让你选择要切换的配置
  2. 快速切换 (ccs next):自动切换到下一个配置,循环往复

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT License

🙏 致谢

本项目基于 claude-config-switch 开发,感谢原作者的贡献。

📝 更新日志

v1.0.0

  • ✨ 新增 ccs next / ccs n 命令,支持快速循环切换配置
  • 🔧 保持原有交互式切换功能
  • 📦 重新打包发布