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

@terranc/ccsc

v1.2.2

Published

Cross-platform CLI tool for CC Switch provider selection with interactive UI (Claude Code + Codex)

Downloads

1,056

Readme

CCSC - CC Switch 跨平台 CLI 工具

English

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

为什么需要这个项目?

作为 CC Switch 的用户,我管理着多个 Claude Code 和 Codex CLI 的服务提供商(Anthropic、国产模型等),经常需要在不同的项目中切换不同的服务商。但 CC Switch 的工作方式是修改全局配置文件,这带来了两个问题:

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

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

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

适用场景:

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

功能特性

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

前置要求

安装

# npm
npm install -g @terranc/ccsc

# 或 bun
bun install -g @terranc/ccsc

# 或直接运行
npx @terranc/ccsc

使用方法

启动 Claude Code

ccsc              # 交互式选择服务商 → 启动 Claude
ccsc claude       # 同上

启动 Codex CLI

ccsc codex        # 交互式选择服务商 → 启动 Codex

键盘快捷键

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

传递参数

所有参数直接传递给目标 CLI:

# Claude Code
ccsc --continue
ccsc --print "Hello"
ccsc --model claude-sonnet-4-20250514

# Codex CLI
ccsc codex -- some prompt here

清除生成的配置文件

ccsc --clear

帮助

ccsc --help
ccsc codex --help

环境变量

| 变量 | 说明 | 默认值 | |------|------|--------| | CC_SWITCH_DB_PATH | CC Switch 数据库完整路径 | ~/.cc-switch/cc-switch.db | | CC_SWITCH_HOME | CC Switch 配置目录 | ~/.cc-switch |

数据库路径配置

# 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,最近使用的服务商会显示在列表顶部。

开发

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

# 安装依赖
npm install

# 构建
npm run build

# 本地测试
node dist/index.js

# 全局链接测试
npm link

技术栈

链接

许可证

MIT