
Security News
Suno Breached via Shai-Hulud Worm, Leaked Code Exposes AI Music Scraping
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.
@supertiny99/cc-switch
Advanced tools
Quick TUI for switching Claude Code API providers - fast provider/token switching when quota is exhausted
快速切换 Claude Code API 提供商的 TUI 工具
当 token 额度用尽时,可以快速切换到另一个提供商/token。
npm install -g @supertiny99/cc-switch
git clone <repo-url>
cd cc-switch
npm install
npm link # 链接到本地环境
cc-switch current
输出:
Current Configuration:
Provider: zhipu
Base URL: https://open.bigmodel.cn/api/anthropic
Haiku Model: GLM-4.5-Air
Sonnet Model: GLM-4.7
Opus Model: GLM-4.7
cc-switch list
cc-switch
输入 zh 即可快速定位到 "Zhipu AI",按 Enter 确认。
cc-switch use anthropic
提供商配置文件位于 ~/.claude/profiles/:
~/.claude/
├── settings.json # Claude Code 当前配置
├── profiles/ # 提供商配置目录
│ ├── zhipu.json # 智谱 AI (GLM)
│ ├── anthropic.json # Anthropic 官方
│ └── custom.json # 自定义提供商
└── cc-switch-backups/ # 自动备份目录
在 ~/.claude/profiles/ 创建 JSON 文件:
{
"id": "my-provider",
"name": "我的提供商",
"description": "自定义 API 提供商",
"icon": "🚀",
"config": {
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_token_here",
"ANTHROPIC_BASE_URL": "https://your-api-endpoint.com",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-name",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-name",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-name"
}
}
}
| 命令 | 说明 |
|---|---|
cc-switch | 交互式选择提供商 |
cc-switch use <id> | 直接切换到指定提供商 |
cc-switch list | 列出所有可用提供商 |
cc-switch current | 显示当前配置 |
cc-switch history | 查看备份历史 |
cc-switch restore <file> | 从备份恢复 |
cc-switch/
├── src/
│ ├── index.ts # CLI 入口
│ ├── lib/
│ │ └── config/
│ │ ├── schema.ts # 类型定义
│ │ ├── loader.ts # 配置读取
│ │ └── writer.ts # 配置写入(含备份)
│ └── ui/
│ └── quick-select.ts # 交互式选择
├── package.json
├── tsconfig.json
└── README.md
# 安装依赖
npm install
# 开发模式(热重载)
npm run dev list
# 构建
npm run build
# 本地测试
npm link
cc-switch list
# 运行测试
npm test
src/index.ts 添加:program
.command('my-command')
.description('我的命令')
.action(async () => {
// 你的逻辑
});
新增配置项 - 在 src/lib/config/schema.ts 扩展类型
新增 UI 组件 - 在 src/ui/ 创建新文件
# 1. 测试列出提供商
cc-switch list
# 2. 测试显示当前配置
cc-switch current
# 3. 测试切换提供商
cc-switch use anthropic
cc-switch current # 验证已切换
# 4. 测试备份功能
cc-switch history
# 5. 测试恢复备份
cc-switch restore settings-2025-01-29T14-30-22-123Z.json
# 6. 测试交互式选择
cc-switch # 按 Ctrl+C 取消
npm test
# 确保已构建
npm run build
# 检查 package.json 配置
cat package.json
# 登录 npm(首次需要)
npm login
# 或使用 token 登录
npm token create
npm logout
npm login --registry=https://registry.npmjs.org --auth-only
npm search @supertiny99/cc-switch
# 或访问 https://www.npmjs.com/package/@supertiny99/cc-switch
# 1. 更新版本号
npm version patch # 1.0.0 -> 1.0.1
npm version minor # 1.0.0 -> 1.1.0
npm version major # 1.0.0 -> 2.0.0
# 2. 发布到 npm
npm publish
# 3. 验证发布
npm view @supertiny99/cc-switch
# 公开发布(默认)
npm publish
# 作为一个包的发布范围(@scope/package-name)
npm publish --access public
# 干运行(不实际发布)
npm publish --dry-run
# 发布特定 tag
npm publish --tag beta
# 全局安装测试
npm install -g @supertiny99/cc-switch
# 或使用 npx 直接运行
npx @supertiny99/cc-switch list
npm run build 确保构建成功# 重新链接
npm link
# 或检查全局路径
which cc-switch
# 查看备份
cc-switch history
# 恢复备份
cc-switch restore <backup-file>
# macOS/Linux 可能需要 sudo
sudo npm link
MIT
欢迎提交 Issue 和 Pull Request!
FAQs
Quick TUI for switching Claude Code API providers - fast provider/token switching when quota is exhausted
The npm package @supertiny99/cc-switch receives a total of 68 weekly downloads. As such, @supertiny99/cc-switch popularity was classified as not popular.
We found that @supertiny99/cc-switch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.

Security News
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.