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

@timtou2020/ccsc

v1.0.10

Published

Cross-platform CLI tool for CC Switch provider selection with interactive UI and team workflow support

Readme

CCSC - CC Switch 跨平台 CLI 工具

方便的多 Claude Code 启动器,从 CC Switch 中选择 Claude 服务提供商,随时切换。

为什么需要这个项目?

作为 CC Switch 的用户,我管理着多个 Claude 服务提供商(Anthropic、国产模型等),经常需要在不同的项目中切换不同的服务商。但 CC Switch 的工作方式是修改 ~/.claude/settings.json,这带来了两个问题:

  1. 影响已运行的 Claude 会话 - 当你在 CC Switch 中切换服务商时,所有正在运行的 Claude 实例也会跟着切换,可能导致意外行为
  2. 仅支持全局作用域 - 所有 Claude 会话共享相同的环境变量,难以同时使用不同的服务商

CCSC 通过以下方式解决这些问题:

  • 环境隔离 - 只影响由 CCSC 启动的 Claude 进程,不影响全局设置或其他运行中的实例
  • 不污染配置 - 完全不修改 ~/.claude/settings.json
  • 会话级服务商选择 - 每个终端会话可以使用不同的服务商
  • 快速切换 - 无需打开 GUI,快速交互式选择

适用场景:

  • 同时开发多个使用不同服务商的项目
  • 在不同 Claude 模型间测试同一代码库
  • 并行运行使用不同服务商的 Claude 会话

功能特性

  • 🖥️ 跨平台 - 支持 macOS、Linux、Windows
  • 📦 易于安装 - 通过 npm/bun 安装,无外部依赖
  • 🔍 交互式 UI - 美观的终端界面,支持搜索和预览面板
  • 直接指定 - 使用 --provider 参数跳过交互选择
  • 👀 预览面板 - 选择前查看环境变量配置
  • 📜 历史记录 - 最近使用的服务商排在前面
  • ⌨️ 键盘导航 - 完整的键盘支持,包括 Page Up/Down
  • 🔄 参数透传 - 所有参数直接传递给 Claude CLI

前置要求

安装

# npm
npm install -g @timtou2020/ccsc

# 或 bun
bun install -g @timtou2020/ccsc

# 或直接运行
npx @timtou2020/ccsc

使用方法

交互式选择

运行 ccsc 进行交互式选择(全局安装后):

ccsc

界面包含:

  • 左侧面板:服务商列表,支持搜索
  • 右侧面板:选中服务商的环境变量预览

直接指定服务商(跳过交互式选择)

使用 --provider 参数直接指定服务商名称,无需交互式选择:

# 指定服务商名称(不区分大小写)
ccsc --provider DeepSeek
ccsc --provider Kimi
ccsc --provider MiniMax

# 结合其他 Claude 参数使用
ccsc --provider DeepSeek --continue
ccsc --provider Kimi --dangerously-skip-permissions

适用场景:

  • 脚本自动化启动(如团队开发工作流)
  • 快速启动常用服务商,无需交互选择
  • CI/CD 或自动化工具集成

键盘快捷键

| 按键 | 功能 | |-----|------| | / | 导航服务商列表 | | PgUp / PgDn | 翻页(每页 10 条) | | Enter | 确认选择 | | Esc | 取消 | | 输入文字 | 搜索/过滤服务商 |

传递参数给 Claude

-h/--help-V/--version--provider 外,所有参数都直接传递给 Claude:

ccsc --continue
ccsc --dangerously-skip-permissions
ccsc --print "Hello"
ccsc --model claude-sonnet-4-20250514

# 或使用 npx
npx @terranc/ccsc --continue

帮助

ccsc --help
ccsc --version

环境变量

| 变量 | 说明 | 默认值 | |------|------|--------| | CC_CLI_PATH | Claude CLI 可执行文件路径 | claude | | CC_SWITCH_DB_PATH | CC Switch 数据库完整路径 | ~/.cc-switch/cc-switch.db | | CC_SWITCH_HOME | CC Switch 配置目录 | ~/.cc-switch |

自定义 Claude CLI

你可以通过环境变量或命令行参数指定使用的 CLI:

# 方式一:环境变量
export CC_CLI_PATH=/path/to/happy
ccsc

# 方式二:命令行参数(优先级更高)
ccsc --cli happy
ccsc --cli /path/to/custom-cli

命令行参数 --cli 优先级高于环境变量 CC_CLI_PATH

数据库路径配置

# macOS / Linux
export CC_SWITCH_DB_PATH=/custom/path/cc-switch.db

# Windows (PowerShell)
$env:CC_SWITCH_DB_PATH = "C:\custom\path\cc-switch.db"

# Windows (CMD)
set CC_SWITCH_DB_PATH=C:\custom\path\cc-switch.db

历史记录

服务商使用历史存储在 ~/.ccsc-history,最近使用的服务商会显示在列表顶部。

团队开发工作流(高级)

CCSC 支持通过配置文件实现团队级多角色并行开发:

配置文件

创建 ~/.ai-team/projects.json

{
  "projects": {
    "my-project": {
      "name": "我的项目",
      "description": "项目描述",
      "roles": {
        "backend": {
          "provider": "DeepSeek",
          "workdir": "C:\\Projects\\my-project\\backend",
          "title": "后端开发",
          "description": "API、数据库、业务逻辑"
        },
        "frontend": {
          "provider": "Kimi For Coding",
          "workdir": "C:\\Projects\\my-project\\frontend",
          "title": "前端开发",
          "description": "UI/UX、组件、交互"
        }
      }
    }
  }
}

启动脚本

项目中提供 start-ai-team.ps1 脚本(PowerShell),支持以下用法:

# 启动项目所有角色
.\start-ai-team.ps1 -Project my-project

# 启动单个角色
.\start-ai-team.ps1 -Project my-project -Role backend

# 查看可用项目
.\start-ai-team.ps1 -List

脚本特点

  • Base64 编码命令:避免 PowerShell 引号转义问题
  • Windows Terminal 分頁:每个角色独立窗口
  • 自动 cd 到工作目录:启动后直接进入项目路径
  • 角色过滤:支持启动单个角色或全部角色

使用场景

  • 多角色并行开发(后端/前端/文档)
  • 不同角色使用不同 AI 模型优化成本
  • 团队标准化开发环境

开发

# 克隆仓库
git clone https://github.com/TimTou2020/ccsc.git
cd ccsc

# 安装依赖
npm install

# 构建
npm run build

# 本地测试
node dist/index.js

# 全局链接测试
npm link

技术栈

Links

许可证

MIT