跳转至

Claude 好搭档 cc-switch


2026-02-10 by dongnan

环境描述

$ head -n1 /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.5 LTS"

$ nvm -v
0.39.7

$ node -v
v24.13.0

$ npm -v
11.6.2

$ pnpm -v
8.11.0

问题描述

由于国内使用 Claude Code 受限(Anthropic 禁止国内IP🗣),曲线救国思路是:

  • Claude Code + 国内 LLM 组合。

安装 cc-switch

安装包 https://github.com/farion1231/cc-switch/releases

# 校验文件
$ tee /dev/stderr < sha256.txt | sha256sum -c -
c9ca296ca42ea6a1388bd23b5ed6284eb200e6633e309cd4f8b9ff8138e4d72a  CC-Switch-v3.10.3-Linux-x86_64.deb
CC-Switch-v3.10.3-Linux-x86_64.deb: OK

# 安装报错
sudo apt install ./CC-Switch-*.deb
[sudo] password for dongnan: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cc-switch : Depends: libwebkit2gtk-4.1-0 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

# 尝试修复
sudo apt --fix-broken install
Reading package lists... Done
...省略
The following additional packages will be installed:
  libjavascriptcoregtk-4.1-0 libsoup-3.0-0 libsoup-3.0-common libwebkit2gtk-4.1-0
...省略

# 再次安装
sudo apt install ./CC-Switch-*.deb

使用

输入 cc-switch 命令 / 点击快捷图标 进入软件。

添加第三方API,以 Zhipu 的 GLM模型为例:

  • 首先注册账号

    • 过程略...
  • 获取 API Key

    • 登录后,在个人中心页面,点击 API Keys,创建一个新的 API Key。
  • 添加新的供应商

    • 并填入 API Key,其它默认即可。
  • 切换供应商

    • 选择创建的供应商

验证

进入 Claude Code 验证模型

❯ /status                                                                                                                                                                                               
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
  Settings:  Status   Config   Usage  (←/→ or tab to cycle)


  Version: 2.1.37
  Session name: /rename to add a name
  Session ID: 78e20bd0-xxxx-862cae21576c
  cwd: /home/dongnan/xxx/pds-server
  Auth token: ANTHROPIC_AUTH_TOKEN
  Anthropic base URL: https://open.bigmodel.cn/api/anthropic

  Model: glm-4.7
  Memory:
  Setting sources: User settings
  Esc to cancel

参考

  • https://github.com/farion1231/cc-switch
回到页面顶部