cc-switch-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cc-switch-cli

cc-switch-cli

Skill by ara.so — Devtools Skills collection.
cc-switch-cli is a Rust-based command-line tool for unified management of AI coding assistant configurations. It handles provider switching, MCP server orchestration, prompt presets, community skills, and local proxy routing across Claude Code, Codex, Gemini, OpenCode, and OpenClaw.
ara.so开发的技能——开发工具技能合集。
cc-switch-cli是一款基于Rust开发的命令行工具,用于统一管理AI编码助手的配置。它支持跨Claude Code、Codex、Gemini、OpenCode和OpenClaw平台的提供商切换、MCP服务器编排、提示词预设、社区技能管理以及本地代理路由。

Installation

安装

Quick Install (macOS/Linux)

快速安装(macOS/Linux)

bash
curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
Installs to
~/.local/bin
by default. Override with
CC_SWITCH_INSTALL_DIR
:
bash
CC_SWITCH_INSTALL_DIR=/usr/local/bin curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
Force overwrite existing installation:
bash
CC_SWITCH_FORCE=1 curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
bash
curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
默认安装到
~/.local/bin
。可通过
CC_SWITCH_INSTALL_DIR
指定安装路径:
bash
CC_SWITCH_INSTALL_DIR=/usr/local/bin curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
强制覆盖现有安装:
bash
CC_SWITCH_FORCE=1 curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash

Manual Installation

手动安装

macOS (Universal Binary):
bash
curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-darwin-universal.tar.gz
tar -xzf cc-switch-cli-darwin-universal.tar.gz
chmod +x cc-switch
sudo mv cc-switch /usr/local/bin/
xattr -cr /usr/local/bin/cc-switch  # Remove quarantine attribute
Linux (x64 musl):
bash
curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-linux-x64-musl.tar.gz
tar -xzf cc-switch-cli-linux-x64-musl.tar.gz
chmod +x cc-switch
sudo mv cc-switch /usr/local/bin/
Windows:
Download
cc-switch-cli-windows-x64.zip
, extract, and move
cc-switch.exe
to a directory in
PATH
or run directly.
macOS(通用二进制):
bash
curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-darwin-universal.tar.gz
tar -xzf cc-switch-cli-darwin-universal.tar.gz
chmod +x cc-switch
sudo mv cc-switch /usr/local/bin/
xattr -cr /usr/local/bin/cc-switch  # 移除隔离属性
Linux(x64 musl):
bash
curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-linux-x64-musl.tar.gz
tar -xzf cc-switch-cli-linux-x64-musl.tar.gz
chmod +x cc-switch
sudo mv cc-switch /usr/local/bin/
Windows:
下载
cc-switch-cli-windows-x64.zip
,解压后将
cc-switch.exe
移动到
PATH
中的目录,或直接运行。

Build from Source

从源码构建

Requires Rust 1.85+:
bash
git clone https://github.com/saladday/cc-switch-cli.git
cd cc-switch-cli/src-tauri
cargo build --release
sudo cp target/release/cc-switch /usr/local/bin/
需要Rust 1.85+:
bash
git clone https://github.com/saladday/cc-switch-cli.git
cd cc-switch-cli/src-tauri
cargo build --release
sudo cp target/release/cc-switch /usr/local/bin/

Core Concepts

核心概念

Multi-App Architecture

多应用架构

cc-switch supports five apps via the global
--app
flag:
  • claude
    (default) — Claude Code
  • codex
    — Cursor's Codex
  • gemini
    — Gemini CLI
  • opencode
    — OpenCode
  • openclaw
    — OpenClaw
Example:
bash
cc-switch --app codex provider list
cc-switch --app gemini prompts activate custom-preset
cc-switch通过全局
--app
标志支持五个应用:
  • claude
    (默认)—— Claude Code
  • codex
    —— Cursor的Codex
  • gemini
    —— Gemini CLI
  • opencode
    —— OpenCode
  • openclaw
    —— OpenClaw
示例:
bash
cc-switch --app codex provider list
cc-switch --app gemini prompts activate custom-preset

Interactive vs. Command Mode

交互模式 vs 命令模式

Interactive Mode (TUI):
bash
cc-switch
Navigate with arrow keys, select features, view live status.
Command Mode:
bash
cc-switch provider switch pro-account
cc-switch mcp sync
交互模式(TUI):
bash
cc-switch
使用箭头键导航,选择功能,查看实时状态。
命令模式:
bash
cc-switch provider switch pro-account
cc-switch mcp sync

Provider Management

提供商管理

Providers store API keys, base URLs, and model configurations.
提供商存储API密钥、基础URL和模型配置。

List All Providers

列出所有提供商

bash
cc-switch provider list
cc-switch --app codex provider list  # Codex-specific
bash
cc-switch provider list
cc-switch --app codex provider list  # Codex专属

Show Current Provider

查看当前提供商

bash
cc-switch provider current
bash
cc-switch provider current

Switch Provider

切换提供商

bash
cc-switch provider switch dev-api
Activates the provider named
dev-api
for the current app.
bash
cc-switch provider switch dev-api
为当前应用激活名为
dev-api
的提供商。

Add a New Provider

添加新提供商

Interactive prompt:
bash
cc-switch provider add
Prompts for:
  • Provider name
  • Base URL
  • API key (or
    $ENV_VAR
    reference)
  • Model ID
交互式提示:
bash
cc-switch provider add
提示输入:
  • 提供商名称
  • 基础URL
  • API密钥(或
    $ENV_VAR
    引用)
  • 模型ID

Edit Existing Provider

编辑现有提供商

bash
cc-switch provider edit prod-account
bash
cc-switch provider edit prod-account

Duplicate Provider

复制提供商

bash
cc-switch provider duplicate staging-api
Creates a copy with
-copy
suffix.
bash
cc-switch provider duplicate staging-api
创建一个带有
-copy
后缀的副本。

Delete Provider

删除提供商

bash
cc-switch provider delete old-endpoint
bash
cc-switch provider delete old-endpoint

Export Claude Provider Settings

导出Claude提供商设置

Export to
./.claude/settings.local.json
for Claude Code auto-load:
bash
cc-switch provider export my-provider
Custom output path:
bash
cc-switch provider export my-provider --output ~/.claude/settings-prod.json
导出到
./.claude/settings.local.json
供Claude Code自动加载:
bash
cc-switch provider export my-provider
自定义输出路径:
bash
cc-switch provider export my-provider --output ~/.claude/settings-prod.json

Speed Test

速度测试

bash
cc-switch provider speedtest my-provider
Measures API latency.
bash
cc-switch provider speedtest my-provider
测量API延迟。

Stream Health Check

流健康检查

bash
cc-switch provider stream-check my-provider
Validates streaming endpoint responsiveness.
bash
cc-switch provider stream-check my-provider
验证流端点的响应能力。

Fetch Remote Models

获取远程模型

bash
cc-switch provider fetch-models my-provider
Retrieves available model list from the API endpoint.
bash
cc-switch provider fetch-models my-provider
从API端点检索可用模型列表。

MCP Server Management

MCP服务器管理

Model Context Protocol servers extend AI assistant capabilities.
模型上下文协议(Model Context Protocol)服务器可扩展AI助手的能力。

List MCP Servers

列出MCP服务器

bash
cc-switch mcp list
cc-switch --app codex mcp list
bash
cc-switch mcp list
cc-switch --app codex mcp list

Add MCP Server

添加MCP服务器

Interactive:
bash
cc-switch mcp add
Prompts for:
  • Server name
  • Transport type (stdio/http/sse)
  • Command/URL
  • Arguments/headers
  • Environment variables
  • Enabled apps
交互式:
bash
cc-switch mcp add
提示输入:
  • 服务器名称
  • 传输类型(stdio/http/sse)
  • 命令/URL
  • 参数/请求头
  • 环境变量
  • 启用的应用

Edit MCP Server

编辑MCP服务器

bash
cc-switch mcp edit filesystem-server
bash
cc-switch mcp edit filesystem-server

Delete MCP Server

删除MCP服务器

bash
cc-switch mcp delete old-server
bash
cc-switch mcp delete old-server

Enable/Disable for Specific App

为特定应用启用/禁用

bash
cc-switch mcp enable postgres-mcp --app claude
cc-switch mcp disable postgres-mcp --app codex
bash
cc-switch mcp enable postgres-mcp --app claude
cc-switch mcp disable postgres-mcp --app codex

Validate Command in PATH

验证命令是否在PATH中

bash
cc-switch mcp validate node
cc-switch mcp validate /usr/local/bin/custom-binary
Checks if executable exists and is accessible.
bash
cc-switch mcp validate node
cc-switch mcp validate /usr/local/bin/custom-binary
检查可执行文件是否存在且可访问。

Sync to Live Configs

同步到实时配置

bash
cc-switch mcp sync
cc-switch --app gemini mcp sync
Writes enabled servers to app-specific config files (e.g., Claude's
claude_desktop_config.json
, Codex's
config.toml
).
bash
cc-switch mcp sync
cc-switch --app gemini mcp sync
将启用的服务器写入应用专属配置文件(例如Claude的
claude_desktop_config.json
、Codex的
config.toml
)。

Import from Live Config

从实时配置导入

bash
cc-switch mcp import --app claude
Reads existing MCP servers from the app's config file into cc-switch's database.
bash
cc-switch mcp import --app claude
从应用的配置文件读取现有MCP服务器并导入到cc-switch的数据库中。

Prompts Management

提示词管理

System prompt presets for AI coding assistants.
AI编码助手的系统提示词预设。

List Prompts

列出提示词

bash
cc-switch prompts list
cc-switch --app gemini prompts list
bash
cc-switch prompts list
cc-switch --app gemini prompts list

Show Current Active Prompt

查看当前激活的提示词

bash
cc-switch prompts current
bash
cc-switch prompts current

Activate a Prompt

激活提示词

bash
cc-switch prompts activate rust-expert
Writes content to the app's prompt file (e.g.,
.claude/CLAUDE.md
,
.codex/AGENTS.md
).
bash
cc-switch prompts activate rust-expert
将内容写入应用的提示词文件(例如
.claude/CLAUDE.md
.codex/AGENTS.md
)。

Deactivate Current Prompt

取消激活当前提示词

bash
cc-switch prompts deactivate
Clears the active prompt file.
bash
cc-switch prompts deactivate
清空激活的提示词文件。

Create New Prompt

创建新提示词

Interactive:
bash
cc-switch prompts create
Or provide name upfront:
bash
cc-switch prompts create typescript-tutor
Opens default editor (
$EDITOR
or
vi
) to compose content.
交互式:
bash
cc-switch prompts create
或提前指定名称:
bash
cc-switch prompts create typescript-tutor
打开默认编辑器(
$EDITOR
vi
)编写内容。

Rename Prompt

重命名提示词

bash
cc-switch prompts rename old-name new-name
Interactive if new name omitted:
bash
cc-switch prompts rename old-name
bash
cc-switch prompts rename old-name new-name
若省略新名称则进入交互式:
bash
cc-switch prompts rename old-name

Edit Prompt

编辑提示词

bash
cc-switch prompts edit rust-expert
Opens in editor.
bash
cc-switch prompts edit rust-expert
在编辑器中打开。

Show Full Prompt Content

查看完整提示词内容

bash
cc-switch prompts show rust-expert
Displays content in terminal.
bash
cc-switch prompts show rust-expert
在终端中显示内容。

Delete Prompt

删除提示词

bash
cc-switch prompts delete outdated-preset
bash
cc-switch prompts delete outdated-preset

Skills Management

技能管理

Community skills extend AI assistant capabilities via custom tooling.
社区技能通过自定义工具扩展AI助手的能力。

List Installed Skills

列出已安装的技能

bash
cc-switch skills list
cc-switch --app codex skills list
bash
cc-switch skills list
cc-switch --app codex skills list

Discover Available Skills

发现可用技能

bash
cc-switch skills discover database
cc-switch skills discover postgres
Searches the SSOT skills repository.
bash
cc-switch skills discover database
cc-switch skills discover postgres
搜索SSOT技能仓库。

Install Skill

安装技能

bash
cc-switch skills install postgres-expert
Downloads and registers the skill.
bash
cc-switch skills install postgres-expert
下载并注册技能。

Uninstall Skill

卸载技能

bash
cc-switch skills uninstall postgres-expert
Removes from all apps and deletes local copy.
bash
cc-switch skills uninstall postgres-expert
从所有应用中移除并删除本地副本。

Enable/Disable for App

为应用启用/禁用技能

bash
cc-switch skills enable postgres-expert --app claude
cc-switch skills disable postgres-expert --app codex
bash
cc-switch skills enable postgres-expert --app claude
cc-switch skills disable postgres-expert --app codex

Scan Unmanaged Skills

扫描未管理的技能

bash
cc-switch skills scan
Detects manually placed skill files in app directories.
bash
cc-switch skills scan
检测应用目录中手动放置的技能文件。

Import Unmanaged Skill

导入未管理的技能

bash
cc-switch skills import custom-tool --app claude
Registers existing skill file into cc-switch database.
bash
cc-switch skills import custom-tool --app claude
将现有技能文件注册到cc-switch数据库中。

Show Skill Content

查看技能内容

bash
cc-switch skills show postgres-expert
bash
cc-switch skills show postgres-expert

Sync Skills to Apps

同步技能到应用

bash
cc-switch skills sync
Copies enabled skills to each app's
.skills/
directory.
bash
cc-switch skills sync
将启用的技能复制到每个应用的
.skills/
目录。

Refresh Repository

刷新仓库

bash
cc-switch skills refresh-repo
Updates local cache of available skills.
bash
cc-switch skills refresh-repo
更新可用技能的本地缓存。

Proxy Management

代理管理

Local reverse proxy for multi-provider routing.
用于多提供商路由的本地反向代理。

Show Proxy Configuration

查看代理配置

bash
cc-switch proxy show
Displays routes, target endpoints, and proxy status.
bash
cc-switch proxy show
显示路由、目标端点和代理状态。

Start Proxy Server

启动代理服务器

bash
cc-switch proxy start
Launches on configured port (default:
8080
).
bash
cc-switch proxy start
在配置的端口启动(默认:
8080
)。

Stop Proxy Server

停止代理服务器

bash
cc-switch proxy stop
bash
cc-switch proxy stop

Add Route

添加路由

Interactive:
bash
cc-switch proxy add-route
Prompts for path prefix and target provider.
交互式:
bash
cc-switch proxy add-route
提示输入路径前缀和目标提供商。

Remove Route

删除路由

bash
cc-switch proxy remove-route /api/claude
bash
cc-switch proxy remove-route /api/claude

WebDAV Sync

WebDAV同步

Synchronize cc-switch data across machines.
跨设备同步cc-switch数据。

Show WebDAV Configuration

查看WebDAV配置

bash
cc-switch config webdav show
bash
cc-switch config webdav show

Configure WebDAV

配置WebDAV

Interactive setup:
bash
cc-switch config webdav setup
Prompts for:
  • WebDAV URL
  • Username
  • Password
  • Sync directory
交互式设置:
bash
cc-switch config webdav setup
提示输入:
  • WebDAV URL
  • 用户名
  • 密码
  • 同步目录

Enable/Disable WebDAV Sync

启用/禁用WebDAV同步

bash
cc-switch config webdav enable
cc-switch config webdav disable
bash
cc-switch config webdav enable
cc-switch config webdav disable

Trigger Manual Sync

触发手动同步

bash
cc-switch config webdav sync
Uploads local changes and downloads remote updates.
bash
cc-switch config webdav sync
上传本地更改并下载远程更新。

Environment Diagnostics

环境诊断

Check Local CLI Tools

检查本地CLI工具

bash
cc-switch env tools
Validates presence of:
  • Node.js
  • Python
  • npx
  • uv
  • Common shells
bash
cc-switch env tools
验证以下工具是否存在:
  • Node.js
  • Python
  • npx
  • uv
  • 常见Shell

Validate Installation

验证安装

bash
cc-switch env validate
Runs comprehensive checks on config files, permissions, and app directories.
bash
cc-switch env validate
对配置文件、权限和应用目录运行全面检查。

Configuration Files

配置文件

cc-switch stores data in:
  • macOS/Linux:
    ~/.config/cc-switch/
  • Windows:
    %APPDATA%\cc-switch\
Key files:
  • config.json
    — Main settings
  • providers.json
    — API providers
  • mcp_servers.json
    — MCP server definitions
  • prompts.json
    — Prompt presets
  • skills.json
    — Skill metadata
App-specific files:
  • Claude:
    ~/.claude/claude_desktop_config.json
    ,
    ~/.claude/CLAUDE.md
  • Codex:
    ~/.codex/config.toml
    ,
    ~/.codex/AGENTS.md
  • Gemini:
    ~/.gemini/gemini.toml
    ,
    ~/.gemini/GEMINI.md
  • OpenCode:
    ~/.opencode/config.toml
    ,
    ~/.opencode/AGENTS.md
  • OpenClaw:
    ~/.openclaw/config.toml
    ,
    ~/.openclaw/AGENTS.md
cc-switch将数据存储在:
  • macOS/Linux:
    ~/.config/cc-switch/
  • Windows:
    %APPDATA%\cc-switch\
关键文件:
  • config.json
    — 主设置
  • providers.json
    — API提供商
  • mcp_servers.json
    — MCP服务器定义
  • prompts.json
    — 提示词预设
  • skills.json
    — 技能元数据
应用专属文件:
  • Claude:
    ~/.claude/claude_desktop_config.json
    ,
    ~/.claude/CLAUDE.md
  • Codex:
    ~/.codex/config.toml
    ,
    ~/.codex/AGENTS.md
  • Gemini:
    ~/.gemini/gemini.toml
    ,
    ~/.gemini/GEMINI.md
  • OpenCode:
    ~/.opencode/config.toml
    ,
    ~/.opencode/AGENTS.md
  • OpenClaw:
    ~/.openclaw/config.toml
    ,
    ~/.openclaw/AGENTS.md

Common Workflows

常见工作流

Switching Between Development and Production APIs

在开发和生产API之间切换

bash
undefined
bash
undefined

List providers

列出提供商

cc-switch provider list
cc-switch provider list

Switch to production

切换到生产环境

cc-switch provider switch prod-api
cc-switch provider switch prod-api

Verify

验证

cc-switch provider current
undefined
cc-switch provider current
undefined

Setting Up MCP Servers for Claude

为Claude设置MCP服务器

bash
undefined
bash
undefined

Add filesystem MCP

添加文件系统MCP

cc-switch mcp add
cc-switch mcp add

Select stdio, command: npx, args: -y @modelcontextprotocol/server-filesystem ~/projects

选择stdio,命令:npx,参数:-y @modelcontextprotocol/server-filesystem ~/projects

Enable for Claude

为Claude启用

cc-switch mcp enable filesystem-server --app claude
cc-switch mcp enable filesystem-server --app claude

Sync to live config

同步到实时配置

cc-switch mcp sync
undefined
cc-switch mcp sync
undefined

Activating a Custom Prompt Preset

激活自定义提示词预设

bash
undefined
bash
undefined

Create new prompt

创建新提示词

cc-switch prompts create senior-rust-dev
cc-switch prompts create senior-rust-dev

Edit content in $EDITOR

在$EDITOR中编辑内容

Activate for Claude

为Claude激活

cc-switch --app claude prompts activate senior-rust-dev
cc-switch --app claude prompts activate senior-rust-dev

Verify

验证

cat ~/.claude/CLAUDE.md
undefined
cat ~/.claude/CLAUDE.md
undefined

Installing Community Skills

安装社区技能

bash
undefined
bash
undefined

Discover available skills

发现可用技能

cc-switch skills discover postgres
cc-switch skills discover postgres

Install

安装

cc-switch skills install postgres-mcp
cc-switch skills install postgres-mcp

Enable for Codex

为Codex启用

cc-switch skills enable postgres-mcp --app codex
cc-switch skills enable postgres-mcp --app codex

Sync

同步

cc-switch skills sync
undefined
cc-switch skills sync
undefined

Exporting Provider for Standalone Use

导出提供商供独立使用

bash
undefined
bash
undefined

Export current provider to Claude auto-load location

将当前提供商导出到Claude自动加载位置

cc-switch provider export my-provider
cc-switch provider export my-provider

Or custom path

或自定义路径

cc-switch provider export my-provider --output ~/Desktop/claude-config.json
undefined
cc-switch provider export my-provider --output ~/Desktop/claude-config.json
undefined

Troubleshooting

故障排除

Provider Switch Not Taking Effect

提供商切换未生效

Ensure sync has run:
bash
cc-switch mcp sync
cc-switch prompts activate <current-prompt>
Restart the AI assistant app.
确保已执行同步:
bash
cc-switch mcp sync
cc-switch prompts activate <current-prompt>
重启AI助手应用。

MCP Server Not Showing Up

MCP服务器未显示

Check PATH for the command:
bash
cc-switch mcp validate npx
Verify enabled apps:
bash
cc-switch mcp list
Re-sync:
bash
cc-switch mcp sync
检查命令是否在PATH中:
bash
cc-switch mcp validate npx
验证启用的应用:
bash
cc-switch mcp list
重新同步:
bash
cc-switch mcp sync

Prompt File Not Updated

提示词文件未更新

Confirm prompt is activated:
bash
cc-switch prompts current
Manually activate:
bash
cc-switch prompts activate <name>
Check file exists:
bash
cat ~/.claude/CLAUDE.md
确认提示词已激活:
bash
cc-switch prompts current
手动激活:
bash
cc-switch prompts activate <name>
检查文件是否存在:
bash
cat ~/.claude/CLAUDE.md

Skill Not Available in Assistant

技能在助手中不可用

Ensure enabled for correct app:
bash
cc-switch skills enable <skill-name> --app claude
Sync skills:
bash
cc-switch skills sync
Restart assistant.
确保为正确的应用启用:
bash
cc-switch skills enable <skill-name> --app claude
同步技能:
bash
cc-switch skills sync
重启助手。

WebDAV Sync Failing

WebDAV同步失败

Verify credentials:
bash
cc-switch config webdav show
Test connection:
bash
cc-switch config webdav sync
Check network/firewall settings.
验证凭据:
bash
cc-switch config webdav show
测试连接:
bash
cc-switch config webdav sync
检查网络/防火墙设置。

Permission Errors

权限错误

Ensure config directory is writable:
bash
ls -la ~/.config/cc-switch/
chmod -R u+w ~/.config/cc-switch/
On macOS, grant Full Disk Access to Terminal in System Preferences > Privacy & Security.
确保配置目录可写:
bash
ls -la ~/.config/cc-switch/
chmod -R u+w ~/.config/cc-switch/
在macOS上,在“系统设置”>“隐私与安全性”中为终端授予“完全磁盘访问”权限。

Environment Variables

环境变量

  • CC_SWITCH_INSTALL_DIR
    — Install location (default:
    ~/.local/bin
    )
  • CC_SWITCH_FORCE
    — Force overwrite during install (
    1
    to enable)
  • CC_SWITCH_LINUX_LIBC
    — Linux libc variant (
    glibc
    or
    musl
    , default:
    musl
    )
  • EDITOR
    — Text editor for prompt/skill editing (default:
    vi
    )
  • CC_SWITCH_INSTALL_DIR
    — 安装位置(默认:
    ~/.local/bin
  • CC_SWITCH_FORCE
    — 安装时强制覆盖(
    1
    启用)
  • CC_SWITCH_LINUX_LIBC
    — Linux libc变体(
    glibc
    musl
    ,默认:
    musl
  • EDITOR
    — 用于编辑提示词/技能的文本编辑器(默认:
    vi

Example: Multi-App Provider Workflow

示例:多应用提供商工作流

bash
undefined
bash
undefined

Add a shared API provider

添加共享API提供商

cc-switch provider add
cc-switch provider add

Name: shared-api

名称:shared-api

API key: $MY_API_KEY

API密钥:$MY_API_KEY

Model: claude-3-5-sonnet-20241022

模型:claude-3-5-sonnet-20241022

Switch Claude to this provider

将Claude切换到该提供商

cc-switch --app claude provider switch shared-api
cc-switch --app claude provider switch shared-api

Switch Codex to the same provider

将Codex切换到同一提供商

cc-switch --app codex provider switch shared-api
cc-switch --app codex provider switch shared-api

Verify both

验证两者

cc-switch --app claude provider current cc-switch --app codex provider current
undefined
cc-switch --app claude provider current cc-switch --app codex provider current
undefined

Example: Creating a Custom Skill

示例:创建自定义技能

bash
undefined
bash
undefined

Create new skill

创建新技能

cc-switch skills create --name custom-debugger
cc-switch skills create --name custom-debugger

Edit in $EDITOR, add content:

在$EDITOR中编辑,添加内容:

---

---

name: custom-debugger

name: custom-debugger

description: Advanced debugging patterns for Rust

description: Advanced debugging patterns for Rust

triggers:

triggers:

- "debug this Rust code"

- "debug this Rust code"

- "add debugging instrumentation"

- "add debugging instrumentation"

---

---

# Custom Debugger Skill

# Custom Debugger Skill

Use
dbg!()
for quick variable inspection...

Use
dbg!()
for quick variable inspection...

Save and exit editor

保存并退出编辑器

Enable for Claude and Codex

为Claude和Codex启用

cc-switch skills enable custom-debugger --app claude cc-switch skills enable custom-debugger --app codex
cc-switch skills enable custom-debugger --app claude cc-switch skills enable custom-debugger --app codex

Sync

同步

cc-switch skills sync
undefined
cc-switch skills sync
undefined

Example: Testing API Health

示例:测试API健康状况

bash
undefined
bash
undefined

Speed test

速度测试

cc-switch provider speedtest prod-api
cc-switch provider speedtest prod-api

Stream health check

流健康检查

cc-switch provider stream-check prod-api
cc-switch provider stream-check prod-api

Fetch available models

获取可用模型

cc-switch provider fetch-models prod-api
undefined
cc-switch provider fetch-models prod-api
undefined

Integration with CI/CD

与CI/CD集成

Export provider config for automated setups:
bash
#!/bin/bash
导出提供商配置用于自动化设置:
bash
#!/bin/bash

ci-setup.sh

ci-setup.sh

Install cc-switch

安装cc-switch

Add CI provider

添加CI提供商

cc-switch provider add
--name ci-api
--base-url "$CI_API_URL"
--api-key "$CI_API_KEY"
--model claude-3-5-sonnet-20241022
cc-switch provider add
--name ci-api
--base-url "$CI_API_URL"
--api-key "$CI_API_KEY"
--model claude-3-5-sonnet-20241022

Switch to it

切换到该提供商

cc-switch provider switch ci-api
cc-switch provider switch ci-api

Export for downstream tools

导出供下游工具使用

cc-switch provider export ci-api --output ./claude-settings.json

This skill enables AI coding agents to help developers install, configure, and operate cc-switch-cli across all supported AI assistant platforms with real command examples and practical workflows.
cc-switch provider export ci-api --output ./claude-settings.json

该技能使AI编码代理能够帮助开发者在所有支持的AI助手平台上安装、配置和操作cc-switch-cli,并提供真实的命令示例和实用工作流。