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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@claude-cli/ccs

v1.0.2

Published

Claude Code Switcher - A CLI tool for managing multiple Claude Code API providers

Downloads

306

Readme

CCS - Claude Code Switcher

A CLI tool for managing multiple Claude Code API providers.

一个用于管理多个 Claude Code API 商家配置的命令行工具。

Installation / 安装

npm install -g @claude-cli/ccs

Features / 特性

  • Auto-import current Claude Code config on first run / 首次运行自动导入当前 Claude Code 配置
  • Backup before switching / 切换前自动备份
  • Bilingual support (English/Chinese) / 中英双语支持
  • Quota tracking and display / 额度用量跟踪与显示
  • Beautiful table display with borders / 美观的带边框表格显示

Commands / 命令

| Command | Alias | Description (EN) | 描述 (中文) | |---------|-------|------------------|-------------| | ccs | - | Interactive switch | 交互式切换商家 | | ccs list | ccs ls | List all providers | 列出所有商家 | | ccs add | ccs a | Add a new provider | 添加新商家 | | ccs edit [name] | ccs e [name] | Edit a provider | 编辑商家配置 | | ccs use [name] | ccs u [name] | Switch to a provider | 快速切换商家 | | ccs remove [name] | ccs rm [name] | Remove a provider | 删除商家 | | ccs current | ccs c | Show current config | 显示当前配置 | | ccs refresh [name] | ccs r [name] | Refresh quota info | 刷新额度信息 | | ccs lang | - | Switch language | 切换语言(中/英) | | ccs --version | ccs -v | Show version | 显示版本号 | | ccs --help | ccs -h | Show help | 显示帮助信息 |

Screenshots / 截图

2025-12-01-17-26-05

Quota Configuration / 额度配置

When adding or editing a provider, you can optionally configure quota display:

添加或编辑商家时,可以选择配置额度显示:

  1. User ID - Found in provider's settings page / 在商家设置页面查看
  2. Access Token - Found in Settings → Security Settings / 在设置-安全设置中获取

Once configured, run ccs refresh to update quota info, or it will auto-fetch when adding/editing.

配置完成后,运行 ccs refresh 刷新额度信息,或在添加/编辑时自动获取。

Configuration / 配置

Config File / 配置文件

~/.ccs.json

{
  "lang": "zh",
  "current": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "providers": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "OpenRouter",
      "description": "Main provider, cheap",
      "baseURL": "https://openrouter.ai/api/v1",
      "apiKey": "sk-or-xxx",
      "balanceConfig": {
        "enabled": true,
        "userId": "12345",
        "accessToken": "your-access-token"
      },
      "usedBalance": 12.5,
      "totalBalance": 100
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "OneAPI",
      "description": "Company internal API",
      "baseURL": "https://api.example.com/v1",
      "apiKey": "sk-xxx"
    }
  ]
}

Provider Fields / 商家字段

| Field | Required | Description (EN) | 描述 (中文) | |-------|----------|------------------|-------------| | id | Yes | UUID identifier | UUID 标识符 | | name | Yes | Provider name | 商家名称 | | description | No | Description/notes | 描述/备注 | | baseURL | Yes | API base URL | API 地址 | | apiKey | Yes | API key | API 密钥 | | balanceConfig | No | Quota config object | 额度配置对象 | | balanceConfig.enabled | No | Enable quota display | 启用额度显示 | | balanceConfig.userId | No | User ID for API | 用户 ID | | balanceConfig.accessToken | No | Access token for API | 访问令牌 | | usedBalance | No | Used quota (USD) | 已用额度 (美元) | | totalBalance | No | Total quota (USD) | 总额度 (美元) |

Switch Mechanism / 切换机制

When switching providers / 切换商家时:

  1. Backup ~/.claude/settings.json~/.claude/settings.json.backup
  2. Write ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN to ~/.claude/settings.json

Tech Stack / 技术栈

License

MIT