简报·YT
← 返回 GitHub 动态
farion1231/cc-switch · ⭐ 已Star 已完成

farion1231/cc-switch v3.19.2

2026-08-06 04:39 · ⭐ 12.5万 · GitHub Release 原文 ↗
#版本更新 #用量修复 #安全加固

farion1231/cc-switch v3.19.2

一句话概括:本版以“把数字算对、把边界扎紧”为主线,修复 Codex 用量在计数器交错场景下被多算数倍的问题,并完成六项安全加固、多项管理面板体验优化与性能提速,无数据库迁移。

▸ Release Notes 英文原文(16854 字符)
# CC Switch v3.19.2 > 这一版的主线是**把数字算对、把边界扎紧**:Codex 用量统计修掉一个会把交错计数器文件多算数倍的缺陷——升级后新数据即刻正确,历史虚高可用一次手动重建回正(见「升级提醒」);一轮六项安全加固把用量脚本、会话日志、目录文件与代理缓冲响应体的无界读取全部封顶。日常顺手的部分也补齐了:MCP / 提示词 / Skills 面板可以搜索,MCP 与 Skills 还能按应用一键批量开关;认证中心逐账号显示 ChatGPT 订阅用量;OMO 用户拿回可用的集成。两条写盘路径批量化之后,大数据库的备份导入、自动同步与用量重导入不再动辄卡住。本版**没有数据库迁移**。 **[English →](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/release-notes/v3.19.2-en.md) | [日本語版 →](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/release-notes/v3.19.2-ja.md)** --- ## 重点内容:你现在可以 - **拿到正确的 Codex 用量数字**:真实日志里存在计数器交错的文件——同一份快照被网关换着限额桶反复重播,或两个累计计数器交替出现——旧算法会把它们当成新增量,现场文件实测有 6 到 8 倍虚高。修复经近 1,900 份真实会话文件回放验证,与独立重算的理想值偏差 0.001%。历史数据不会被自动改写,回正方法见[升级提醒](#codex-历史用量虚高需手动重建一次)。 - **在 MCP、提示词、Skills 面板里直接搜索**:三个面板都有了搜索框;MCP 与 Skills 列表上的应用徽章还变成了三态开关,一键把某个应用在整张列表上批量启用或停用([#5954](https://github.com/farion1231/cc-switch/issues/5954)、[#5935](https://github.com/farion1231/cc-switch/issues/5935) 都是用户之声)。 - **让新版 Claude Code 直接进入 Copilot 接管的会话**:新版 Claude Code 对不认识的 API key 会弹确认框、且默认选中「No (recommended)」,此前接管写入的占位符正好撞上它,用户看到的是一个未登录的会话。现在改写 `ANTHROPIC_AUTH_TOKEN` 占位符,零弹窗直接进入。 - **继续用 CC Switch 管理 OMO**:OMO 4.19.3 起配置统一进 `~/.omo/omo.jsonc`,旧文件不再被读取,此前的供应商切换看似成功、实则全部落空。现在检测到统一配置文件(`omo.jsonc` 或 `omo.json`)就写进它的 `"[opencode]"` 分区。OMO 表单的模型选择器还会合并 `opencode models` 实际报告的运行时模型。 - **在认证中心看到每个 ChatGPT 账号的订阅用量**:多账号场景下不再需要逐个切换查看。 - **在大数据库上不再动辄卡住**:备份导出改为批量 INSERT、同步恢复改为单事务——此前每行一次 fsync 正是自动同步周期性卡顿的元凶;Codex 用量全量重导入在真实语料上从 36.3 秒降到 11.1 秒(macOS),Windows 收益更大。 - **看到被网关吞掉的工具调用,而不是被静默晾在原地**:第三方 Chat 网关返回缺函数名的工具调用时,转换层此前把它们丢掉还报「本轮完成」,Codex 于是无声地结束了循环。现在这种情况会明确报错,且丢弃点带结构化日志,[#4341](https://github.com/farion1231/cc-switch/issues/4341) 这类问题终于可以从真实流量里诊断。 - **让 Hermes 提示词真正生效**:写入 Hermes 实际加载的 `~/.hermes/SOUL.md`,而不是它从不读取的 `AGENTS.md`。 - **装上此前装不了的 Skill**:ast-grep 这类带同名空壳目录的仓库能装了;skills.sh 嵌套 Skill 的 README 链接不再 404(存量记录需重装一次恢复,见[升级提醒](#嵌套-skill-的存量记录需要重装一次))。 --- ## 使用攻略 本版的改动集中在用量统计与扩展管理面板上,建议结合以下文档了解: - **[用量统计](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/user-manual/zh/4-proxy/4.4-usage.md)**:用量看板的数据来源与统计口径,理解交错计数器多算是怎么发生的、什么情况下需要手动重建。 - **[MCP 管理](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/user-manual/zh/3-extensions/3.1-mcp.md)** 与 **[Skills 管理](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/user-manual/zh/3-extensions/3.3-skills.md)**:新的搜索与批量开关所在的两个面板。 --- > [!WARNING] > > ## 唯一官方渠道声明(请务必阅读) > > CC Switch 是**完全免费、开源**的桌面应用,**不会向用户收取任何费用**。请仅通过下列官方渠道获取本软件: > > | 类别 | 唯一官方 | > | -------- | ------------------------------------------------------------------------------ | > | 官网 | **[ccswitch.io](https://ccswitch.io)** | > | 源码 | **[github.com/farion1231/cc-switch](https://github.com/farion1231/cc-switch)** | > | 下载 | **[GitHub Releases](https://github.com/farion1231/cc-switch/releases)** | > | 作者 | **[@farion1231](https://github.com/farion1231)** | > | 举报山寨 | **[GitHub Issues](https://github.com/farion1231/cc-switch/issues)** | > > **任何向你收费、要求充值、或索取登录凭据的"CC Switch"网站或客户端均为假冒**。如果你被诱导支付了费用,请立即停止操作并通过 GitHub Issues 反馈。 --- ## 概览 CC Switch v3.19.2 是一次以正确性为主的维护版本,主线有三条。第一条是把数字算对:Codex 会话导入器在计数器交错的文件上会把用量多算数倍([#3011](https://github.com/farion1231/cc-switch/issues/3011)),本版换用「优先取每轮增量、按完整签名识别重播」的算法,并以近 1,900 份真实会话文件的回放验证收口;备份与用量导入两条写盘路径同时批量化,大数据库导入卡顿显著缓解([#2100](https://github.com/farion1231/cc-switch/issues/2100) 或将受益)。 第二条是把边界扎紧:一轮外部贡献的安全加固把用量脚本运行时、Grok 会话日志、Codex 目录文件与代理缓冲响应体的无界读取全部封顶,深链导入确认框补上两个此前收集却不显示的凭据字段。第三条是把日常顺手的东西补齐:MCP / 提示词 / Skills 三个面板的搜索、MCP 与 Skills 的批量应用开关、认证中心的逐账号订阅用量,以及 OMO 的统一配置与运行时模型两项适配。此外还有 Copilot 登录、Hermes 提示词、Skill 安装等七个具体故障修复。本版**没有数据库 schema 迁移**(版本号保持 v16),升级轻量。 **发布日期**:2026-08-06 **更新规模**:24 commits | 109 files changed | +12,340 / -1,897 lines --- ## 新功能 ### 管理面板:搜索与批量应用开关 MCP、提示词、Skills 三个面板都有了共享的搜索框——按 Esc 清空,且只在有内容时拦截全局返回快捷键,不影响你平时的操作习惯。MCP 与 Skills 列表顶部的应用计数徽章变成了三态开关按钮:一键把某个应用在整张列表上批量启用或停用,逐条点开关的日子结束了([#5954](https://github.com/farion1231/cc-switch/issues/5954)、[#5935](https://github.com/farion1231/cc-switch/issues/5935))。 批量操作刻意**串行执行**而不是并发——每个应用的 live 配置是单个文件,并发写会互相覆盖;失败的条目会被收集起来一次性报告。批量开关作用于**整张列表**而不是搜索过滤后的子集,避免「以为只开了过滤结果、实际状态不明」的歧义。 底层还顺手修掉两个数据层的老问题:MCP 开关从「读整行、改内存、写整行」改为单列原子 UPDATE,两个应用几乎同时切换时不再互相丢失更新;Skill 更新落库前会重新确认记录仍然存在、安装代数未变,慢速更新任务不再可能复活一个刚被卸载的 Skill。搜索索引是显式白名单——环境变量与请求头**永远不进**可搜索文本。 ### 认证中心:逐账号订阅用量 设置 → 认证中心现在给每个 ChatGPT(Codex OAuth)账号内联显示订阅用量,复用供应商卡片页脚已有的查询——按账号去重、缓存五分钟、挂载时拉取一次不轮询。多账号用户不用再逐个切换查看余量。([#4887](https://github.com/farion1231/cc-switch/pull/4887)) ### OMO 模型选择器合并运行时模型 OMO 表单的模型选择器此前只有静态列表;现在还会运行 `opencode models`,把本机安装的 OpenCode 实际报告的模型合并进来。这个辅助进程被刻意关进沙箱:禁用项目级配置发现、工作目录钉死在 OpenCode 配置目录——打开一个表单绝不会执行某个项目的 `.opencode/` 插件;整个过程限时 20 秒,超时后杀掉完整进程树(macOS / Linux 用进程组,Windows 用 `taskkill /T`,WSL 在发行版内部用 `timeout`)。任何失败都回落到静态列表并弹提示。([#5522](https://github.com/farion1231/cc-switch/pull/5522)) ### Qwen3.8 Max 内置定价 `qwen3.8-max` 按官方牌价播种:每百万 token 输入 $2 / 输出 $6,缓存读取 $0.25,缓存写入 $2.50(输入价的 125%,官方显式上下文缓存费率)。按「不存在才插入」播种,你自己改过的价格不受影响。([#6053](https://github.com/farion1231/cc-switch/pull/6053)) --- ## 变更 ### 预设清单维护 NekoCode 与 Unity2.ai 的合作伙伴预设从所有应用、README 与语言文件中移除;七牛预设的排序调整。 --- ## 修复 ### Codex 用量在计数器交错时被多算(最高数倍) 会话导入器此前从单一高水位线对累计值求差——一份文件里只有一个单调计数器时这是对的,但真实日志里存在两种交错形态:网关把同一份**未变化**的快照换着限额桶反复重播,以及两个真正不同的累计计数器交替出现。旧算法在这两种形态上都会把重播或交替当成新增量,现场文件实测有 6 到 8 倍虚高。 现在导入器优先读取每个事件显式携带的「本轮用量」,并按完整 token 签名识别重播。去重刻意收窄:一份快照只与**同一来源自己的上一份签名**或**紧邻的前一个 token 事件**比对——不与其它来源的旧签名比对,因为合法的计数器重置会重现旧数值,扫全表会把它误吞。只有累计值的旧格式回退到单一全局基线,语义与从前一致。 修复用近 1,900 份、共 1.7 GB 的真实会话文件回放验证:与独立重算的理想值偏差 0.001%,残余差异全部是旧算法把计数器重置截断吞掉、新算法合法救回的请求。历史数据刻意不改写——回正方法见「升级提醒」。([#3011](https://github.com/farion1231/cc-switch/issues/3011)、[#3015](https://github.com/farion1231/cc-switch/issues/3015)) ### 被丢弃的工具调用不再伪装成「本轮完成」 第三方 Chat 网关偶尔会返回**缺函数名**的工具调用,Chat → Responses 转换层此前把它们静默丢弃、还照样报告本轮 `completed`——Codex 看到一个「成功但无事可做」的回合,就安静地结束了智能体循环,一个本可诊断的上游故障变成了无声停摆。 现在,当一轮里的工具调用全部被丢弃、没有任何可用项时,流式路径发出 `response.failed`,非流式路径报转换错误;判定挂在 `status == "completed"` 上,`finish_reason: length` 的截断保持自己的 `incomplete` 语义不受影响。三个丢弃点都会记录结构化、不含内容的日志字段——是否有 call id、参数字节数、结束原因——[#4341](https://github.com/farion1231/cc-switch/issues/4341) 这类问题终于可以从真实流量里诊断。含有效工具调用的回合、纯文本回合与截断回合行为不变。 ### OMO 的配置写进了它不再读取的文件 OMO 4.19.3 把配置统一进 `~/.omo/omo.jsonc`(其次 `omo.json`),迁移时会把旧的按应用文件改名挪走。此后 CC Switch——只认识旧路径——一直在写一个不在 OMO 配置链上的文件,供应商切换看似成功、实则全部落空([#5945](https://github.com/farion1231/cc-switch/issues/5945))。 现在检测到统一配置文件就把 OpenCode 配置写进 OMO 的 `"[opencode]"` 分区——并且**只写在这里**,因为 OMO 对根层 schema 严格校验,任何未知根键都会让它丢弃整份文件。写入把文档当 JSON5 对待:注释、键序与行尾原样保留,内容没变化就不落盘;每次写出前还会把结果重新解析、与预期做语义比对——如果序列化会损坏文档,写入被拒绝、原文件原样保留,绝不落盘一份坏文件(已知触发场景见「升级提醒」)。同一改动还把所有受管应用在 Windows 上的原子写入换成 `ReplaceFileW`,堵上了旧「先删后改名」序列里目标文件短暂不存在的窗口。 ### Copilot 接管在新版 Claude Code 上进不了登录态 新版 Claude Code 对不认识的 API key 会弹确认框、默认选中「No (recommended)」——Copilot 接管此前写入的 `ANTHROPIC_API_KEY` 占位符正好撞上它:按推荐走,key 被忽略,用户面对的是一个未登录的会话。接管现在改写 `ANTHROPIC_AUTH_TOKEN` 占位符,零弹窗直接进入;在供应商表单高级区显式选择了 `ANTHROPIC_API_KEY` 字段的供应商保持旧行为。Copilot 转发路径还补上了其它路径早就有的 `[1M]` 上下文标记剥离,`claude-*[1M]` 形态的模型 ID 不再原样发给 GitHub 的 API。([#5832](https://github.com/farion1231/cc-switch/pull/5832)) ### Hermes 提示词写错了文件名 Hermes 从 `~/.hermes/` 加载的身份文件是 `SOUL.md`,从不在那里找 `AGENTS.md`——后者是项目级上下文,从工作目录向上发现。CC Switch 的提示词管理从加入 Hermes 支持那天起写的就是 `~/.hermes/AGENTS.md`,启用 Hermes 提示词产出的是一个死文件。现在读写 `~/.hermes/SOUL.md`,既有的回填机制照常生效:你自己写过的 SOUL.md 会先导入数据库再被替换。([#5777](https://github.com/farion1231/cc-switch/issues/5777)) ### 带同名空壳目录的 Skill 仓库装不上 安装 ast-grep 官方 Skill 报「缺少 SKILL.md」:这个仓库在根下有一个与 Skill 同名的空壳目录,真正的 Skill 嵌套在更深处,而解析器返回了第一个名字匹配的目录。源目录解析现在以 SKILL.md 本身为锚点——没有它的目录绝不会被选中——顺带修好了同类仓库上「更新检查永远报有更新」的幻影提示。([#4141](https://github.com/farion1231/cc-switch/issues/4141)) ### skills.sh 嵌套 Skill 的 README 链接 404 skills.sh 的发现流程只报告 Skill 的末级目录名;安装时能解析出真实的嵌套目录,但入库的 README 链接仍按目录名猜测构建,点开就是 404。链接现在从安装器**实际解析出的目录**生成。修复只作用于安装链路——旧版本写入的记录要重装一次才能恢复,见「升级提醒」。([#6111](https://github.com/farion1231/cc-switch/issues/6111)) ### 全部应用启用时头部按钮被裁掉 所有应用页签、项目切换器与接管开关同时显示时,头部溢出,「添加供应商」按钮被裁掉。主要操作现在固定在不收缩的区块里,应用切换器变成宽度感知:放不下的应用折叠进「更多」弹出层,当前应用始终可见。 ### 路由状态动画在后台空耗 GPU 路由状态指示器的脉冲动画在窗口失焦时照常运行,为一个纯装饰效果持续占用 GPU。现在窗口焦点通过 data 属性与 CSS 控制心跳——失焦时动画冻结在完整不透明度,系统的「减少动态效果」偏好则完全禁用它。数据轮询不受影响,暂停的只是装饰。([#5767](https://github.com/farion1231/cc-switch/pull/5767)) --- ## 安全加固 ### 无界读取全部封顶,确认框不再隐藏字段 一轮六项的外部贡献加固([#5919](https://github.com/farion1231/cc-switch/pull/5919)): - **用量脚本限资源限时**:用量脚本可以经深链或同步的数据库到达本机,此前跑在没有任何限制的 JS 运行时上,一句 `while(true)` 就能把后端线程永远挂死。现在运行时强制 5 秒中断、16 MiB 内存与 256 KiB 栈上限。 - **Grok 会话日志读取设界**:跳过超过 50 MiB 的文件,目录递归限深 16 层且不再跟随符号链接——`~/.grok/sessions` 下的一个符号链接环此前能造成栈溢出。 - **Codex 模型目录路径收紧**:`model_catalog_json` 此前只看文件名就信任任意绝对路径;现在必须解析到 Codex 配置目录之内——`canonicalize` 之后复查一遍,符号链接逃不出去——单次读取上限 32 MiB。 - **代理缓冲响应体封顶**:会被完整收集的响应体——非流式响应、错误响应与需要整体校验的路径——上限 128 MiB,并且在分块到达时即时累计、越限立即断开连接,而不是先收完再比较;流式路径(透传与流式转换)本就不整体缓冲,不设总量上限。 - **解压预算前置**:解压配额加在解码器读取侧,gzip、deflate、zstd、brotli 全覆盖,压缩炸弹无法不受控地膨胀;越限响应映射为独立的 502,不会被误判为可重试的网络错误。 - **深链确认框补上两个字段**:供应商导入确认框此前会解析并持久化 `usageAccessToken` 与 `usageUserId`,却从不显示它们;现在两个字段都在批准前展示,令牌照常脱敏。 --- ## 性能 ### 备份:导出批量化,恢复单事务 两个方向各有一个独立的成本。**导出侧**此前每行数据一条 INSERT,导入大备份时 SQLite 要逐条解析、准备、销毁数万条语句;现在按 200 行 / 1 MB 一批生成多行 INSERT,语句数少两个数量级,备份文件本身也缩小约 4 倍。**恢复侧**,每次 WebDAV / S3 同步导入后要把保留在本地的表逐行写回,此前每一行都是一个隐式事务——每行付一次完整的日志写入与 fsync,正是大库自动同步周期性卡住应用的元凶;现在整个恢复在单个事务内完成。 旧格式的单行备份照常导入,新格式也在所有随应用分发的 SQLite 支持范围内,跨版本双向兼容。[#2100](https://github.com/farion1231/cc-switch/issues/2100) 报告的跨机导入卡死很可能因此缓解——欢迎在该 issue 反馈实测结果。([#6122](https://github.com/farion1231/cc-switch/pull/6122)) ### Codex 用量全量重导入提速约 3 倍,Windows 收益更大 全量重导入——导入 v16 之前的 SQL 备份、跨机恢复后游标不匹配、或手动重建时触发——在大语料上会把一个 CPU 核心跑满数分钟:每个 token 事件各自构成一个自动提交事务,每行付一次完整的日志创建 / fsync / 删除循环;每个归档文件还要跑一条用不上索引的游标继承查询。 现在事件按 1,000 条一批提交,批间释放连接锁,界面查询得以插队;游标在与最后一批相同的事务里推进,崩溃永远不会让游标领先于数据;游标与模型定价每趟预载一次,热点语句预编译缓存。1,920 份 / 1.7 GB 的真实语料在 macOS(release 构建)上从 36.3 秒降到 11.1 秒;Windows 上每行 fsync 开销约数毫秒,绝对收益大一个数量级。改动前后回放同一语料验证等价:82,000 行导入结果在所有导出列上逐字节一致,导入 / 跳过计数完全相同。 --- ## 升级提醒 ### 本版没有数据库迁移 v3.19.2 不含 schema 迁移(版本号保持 v16),不会触发升级前备份,升级即用。 ### Codex 历史用量虚高需手动重建一次 交错计数器修复**只保证今后正确**:历史行刻意不改写,也没有自动重建。如果你的看板里 Codex 数字高得离谱、且会话文件带交错形态,升级后到 **用量页 → Codex 用量维护 → 「重建 Codex 用量」** 手动重建一次即可——重建前会自动备份数据库;已删除的会话日志对应的历史无法重新导入。本版的导入提速让这次重建比以往快约 3 倍。 大多数安装不受影响:不含交错形态的数据上,新旧算法的差异在千分之一以内。 ### 嵌套 Skill 的存量记录需要重装一次 通过 skills.sh 安装、README 链接 404 的存量 Skill,卸载后重装即可恢复正确链接;原地「更新」不会重写它。 ### 升级后的首次同步会整体重传一次备份文件 备份 dump 的格式变了,而同步协议把它当作整体哈希的不透明工件,所以升级后第一次 WebDAV / S3 同步会完整重传一次 `db.sql`——一次性、无害。 ### Copilot 占位符在下次接管写入时生效 `AUTH_TOKEN` 占位符在接管下一次重写 live 配置时生效——切换供应商或重启接管即可。在供应商表单高级区显式选过 `ANTHROPIC_API_KEY` 字段的供应商不受影响,你的选择原样保留。 ### OMO 统一配置按文件存在性检测 判定依据是文件是否存在、而不是 OMO 版本:`~/.omo/omo.jsonc`(或 `omo.json`)存在时就地编辑它;两者都不存在时照旧写传统的 OpenCode 层文件。已知限制:如果统一配置文件里含**块注释**(`/* … */`),写入会报错拒绝以保护文档——行注释(`//`)不受影响。在上游 JSON5 写入器修复之前,切换供应商前请先移除块注释。 ### 批量开关作用于整张列表 管理面板的批量应用开关作用于全部条目,而不是搜索过滤后的子集。 ### 代理缓冲响应体上限 128 MiB 需要完整缓冲的代理响应——非流式响应与错误响应——超过 128 MiB 时以 502 失败,不再转发;透传的流式响应不受影响。正常的 LLM 响应最多也只有几 MB,这个上限只会在上游异常时触发;这类失败会终止请求,不触发向下一个地址的故障转移。 --- ## 风险提示 ### 沿用的提示 **xAI Grok OAuth 登录**:复用官方 Grok CLI 的公开 OAuth 客户端身份,使用可能导致账号被限制或封禁——详见 [v3.18.0 release notes](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/release-notes/v3.18.0-zh.md#风险提示)。 **Codex OAuth 反向代理**:使用 ChatGPT 订阅的 Codex OAuth 反代可能违反 OpenAI 服务条款,详情见 [v3.13.0 release notes](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/release-notes/v3.13.0-zh.md#️-风险提示)。 **SuperGrok 配额查询**:供应商卡片的配额展示依赖 grok.com 的非公开计费端点,xAI 调整接口后可能失效——详见 [v3.19.0 release notes](https://github.com/farion1231/cc-switch/blob/v3.19.2/docs/release-notes/v3.19.0-zh.md#风险提示)。 **第三方供应商路由**:通过 CC Switch 本地代理把 Codex、Claude Desktop 或 Grok Build 的请求转换并转发到第三方供应商时,各供应商对计费、合规与数据留存的约束不同,请在使用前阅读目标供应商的服务条款。 用户启用上述功能即表示自行承担相关风险。CC Switch 不对因使用这些功能而导致的任何账号限制、警告或服务暂停承担责任。 --- ## 致谢 这一版 24 个提交里有 13 个 PR 来自外部贡献者——9 位贡献者,覆盖了从用量头条修复到安全加固的几乎每一条主线。 ### 代码贡献 - [#5854](https://github.com/farion1231/cc-switch/pull/5854):Codex 交错计数器用量修复——本版头条,感谢 @MJYKIM99。作者自带真实文件证据、按评审意见三轮打磨到全量回放逐位收敛;也感谢 @ayanamislover 用自己的交错文件独立回放,与我们的验证互证。 - [#5919](https://github.com/farion1231/cc-switch/pull/5919)、[#6122](https://github.com/farion1231/cc-switch/pull/6122)、[#6119](https://github.com/farion1231/cc-switch/pull/6119):六项安全加固、备份性能改造与 skills.sh README 修复,感谢 @zayokami——本版的「安全加固」与「性能」两个章节大半出自这三份工作。 - [#6011](https://github.com/farion1231/cc-switch/pull/6011)、[#5522](https://github.com/farion1231/cc-switch/pull/5522)、[#5767](https://github.com/farion1231/cc-switch/pull/5767):OMO 统一配置适配、运行时模型发现与路由状态动画的 GPU 修复,感谢 @allenxu09。 - [#5967](https://github.com/farion1231/cc-switch/pull/5967):管理面板搜索与批量开关,并顺手修掉数据层两个并发老问题,感谢 @YUZHEthefool——他还在 #6119 中协作把修复收敛到最小形态。 - [#4887](https://github.com/farion1231/cc-switch/pull/4887):认证中心逐账号订阅用量,感谢 @SaladDay。 - [#5832](https://github.com/farion1231/cc-switch/pull/5832):Copilot 接管兼容新版 Claude Code,感谢 @Suaig。 - [#5779](https://github.com/farion1231/cc-switch/pull/5779):Hermes 提示词文件名修复,感谢 @mmm-05610——从报告 [#5777](https://github.com/farion1231/cc-switch/issues/5777) 到提交修复一人完成。 - [#4153](https://github.com/farion1231/cc-switch/pull/4153):Skill 源目录以 SKILL.md 为锚点解析,感谢 @makoMakoGo。 - [#6053](https://github.com/farion1231/cc-switch/pull/6053):Qwen3.8 Max 内置定价,感谢 @mhy1227。 ### 问题反馈 - 感谢 @KeShih 在 [#3011](https://github.com/farion1231/cc-switch/issues/3011) 中精确指出「`total_token_usage` 非单调 / 重放被当作新增量」——本版头条修复的问题定义直接来自这条报告,他还在 [#3015](https://github.com/farion1231/cc-switch/issues/3015) 中先行提出了修复思路。 - 感谢 @Syuryuuki 报告 OMO 统一配置未适配([#5945](https://github.com/farion1231/cc-switch/issues/5945))、@abcfy2 报告 ast-grep Skill 无法安装([#4141](https://github.com/farion1231/cc-switch/issues/4141))、@mortalBibo 报告 skills.sh 嵌套 Skill 链接 404([#6111](https://github.com/farion1231/cc-switch/issues/6111))。 - 感谢 @kith13([#5954](https://github.com/farion1231/cc-switch/issues/5954))与 @Getianyu1998([#5935](https://github.com/farion1231/cc-switch/issues/5935))——管理面板的搜索与批量开关正是从这两条建议来的。 --- ## 下载与安装 访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本,或从官网 [ccswitch.io](https://ccswitch.io) 获取(下载经 Cloudflare 边缘节点分发,不依赖 GitHub 可达)。 ### 系统要求 | 系统 | 最低版本 | 架构 | | ------- | -------------------------- | ----------------------------------- | | Windows | Windows 10 及以上 | x64 / ARM64 | | macOS | macOS 12 (Monterey) 及以上 | Intel (x64) / Apple Silicon (arm64) | | Linux | 见下表 | x64 / ARM64 | ### Windows | 文件 | 说明 | | ---------------------------------------- | ----------------------------------- | | `CC-Switch-v3.19.2-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 | | `CC-Switch-v3.19.2-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 | Windows ARM64 设备请选择文件名中带 `arm64` 标识的对应制品。 ### macOS | 文件 | 说明 | | -------------------------------- | --------------------------------------------- | | `CC-Switch-v3.19.2-macOS.dmg` | **推荐** - DMG 安装包,拖入 Applications 即可 | | `CC-Switch-v3.19.2-macOS.zip` | 解压后拖入 Applications,Universal Binary | | `CC-Switch-v3.19.2-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 | Homebrew 安装: ```bash brew install --cask cc-switch ``` 更新: ```bash brew upgrade --cask cc-switch ``` ### Linux Linux 资产同时提供 **x86_64** 和 **ARM64**(`aarch64`)两种架构。资产文件名中包含架构标识,请按你机器的 `uname -m` 输出选择对应版本: - `CC-Switch-v3.19.2-Linux-x86_64.AppImage` / `.deb` / `.rpm` - `CC-Switch-v3.19.2-Linux-arm64.AppImage` / `.deb` / `.rpm` | 发行版 | 推荐格式 | 安装方式 | | --------------------------------------- | ----------- | ---------------------------------------------------------------------- | | Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` 或 `sudo apt install ./CC-Switch-*.deb` | | Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` 或 `sudo dnf install ./CC-Switch-*.rpm` | | openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` | | Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR | | 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
▸ 主项目介绍 · farion1231/cc-switch
▸ README 原文(同步于 2026-07-20 03:47)
<div align="center"> # CC Switch ### The All-in-One Manager for Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw & Hermes Agent [![Version](https://img.shields.io/github/v/release/farion1231/cc-switch?color=blue&label=version)](https://github.com/farion1231/cc-switch/releases) [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/farion1231/cc-switch/releases) [![Built with Tauri](https://img.shields.io/badge/built%20with-Tauri%202-orange.svg)](https://tauri.app/) [![Downloads](https://img.shields.io/github/downloads/farion1231/cc-switch/total)](https://github.com/farion1231/cc-switch/releases/latest) <a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> <a href="https://www.star-history.com/#farion1231/cc-switch&Date"><picture><source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/badge?repo=farion1231/cc-switch&theme=dark" /><img alt="Star History Rank" src="https://api.star-history.com/badge?repo=farion1231/cc-switch" width="196" height="55" /></picture></a> ### 🌐 The Only Official Website: **[ccswitch.io](https://ccswitch.io)** English | [中文](README_ZH.md) | [日本語](README_JA.md) | [Deutsch](README_DE.md) | [Changelog](CHANGELOG.md) </div> ## ❤️Sponsor > [Want to appear here?](mailto:farion1231@gmail.com) <details open> <summary>Click to collapse</summary> [![Kimi K2.7 Code](assets/partners/banners/kimi-banner-en.png)](https://platform.kimi.ai?aff=cc-switch) Kimi K2.7 Code is an open-source, coding-focused agentic model developed by Moonshot AI. It delivers stronger coding and agent performance, with substantial improvements in real-world long-horizon coding tasks. These gains translate into higher end-to-end task success rates across complex software engineering workflows. K2.7 Code also improves reasoning efficiency, reducing thinking-token usage by approximately 30% compared with K2.6. **[Click here to start using Kimi](https://platform.kimi.ai?aff=cc-switch)** Doing mostly coding work? Try the **[Kimi For Coding plan](https://www.kimi.com/code/?aff=cc-switch)** — a subscription service built for coding! --- <table> <tr> <td width="180"><a href="https://www.packyapi.com/register?aff=cc-switch"><img src="assets/partners/logos/packycode.png" alt="PackyCode" width="150"></a></td> <td>Thanks to PackyCode for sponsoring this project! PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. PackyCode provides special discounts for our software users: register using <a href="https://www.packyapi.com/register?aff=cc-switch">this link</a> and enter the "cc-switch" promo code during first recharge to get 10% off.</td> </tr> <tr> <td width="180"><a href="https://aigocode.com/invite/CC-SWITCH"><img src="assets/partners/logos/aigocode.png" alt="AIGoCode" width="150"></a></td> <td>Thanks to AIGoCode for sponsoring this project! AIGoCode is an all-in-one platform that integrates Claude Code, Codex, and the latest Gemini models, providing you with stable, efficient, and highly cost-effective AI coding services. The platform offers flexible subscription plans, zero risk of account suspension, direct access with no VPN required, and lightning-fast responses. AIGoCode has prepared a special benefit for CC Switch users: if you register via <a href="https://aigocode.com/invite/CC-SWITCH">this link</a>, you'll receive an extra 10% bonus credit on your first top-up!</td> </tr> <tr> <td width="180"><a href="https://www.aicodemirror.com/register?invitecode=9915W3"><img src="assets/partners/logos/aicodemirror.jpg" alt="AICodeMirror" width="150"></a></td> <td>Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code / Codex / Gemini CLI, with enterprise-grade concurrency, fast invoicing, and 24/7 dedicated technical support. Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original price, with extra discounts on top-ups! AICodeMirror offers special benefits for CC Switch users: register via <a href="https://www.aicodemirror.com/register?invitecode=9915W3">this link</a> to enjoy 20% off your first top-up, and enterprise customers can get up to 25% off!</td> </tr> <tr> <td width="180"><a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF"><img src="assets/partners/logos/shengsuanyun.png" alt="Shengsuanyun" width="150"></a></td> <td>Thanks to Shengsuanyun for sponsoring this project! Shengsuanyun is a super factory serving AI Native Teams — an industrial-grade AI task parallel execution platform. Its model marketplace aggregates Claude, ChatGPT, Gemini, and other domestic and international LLM and multimedia model capabilities with direct supply. Absolutely no reverse engineering or dilution — platform-wide model SLA availability reaches 99.7%, with <a href="https://watch.shengsuanyun.com/status/shengsuanyun">monitoring dashboards</a> showing green across the board. It also offers enterprise-grade custom gateways for fine-grained team cost and permission management, smart routing, security protection, and BYOK (Bring Your Own Key) hosting. The platform charges on a pay-per-use and tokens plan (coming soon) basis, with invoicing available. Register via <a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF">this link</a> as a new user to receive ¥10 in credits plus a 10% bonus on your first top-up.</td> </tr> <tr> <td width="180"><a href="https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/"><img src="assets/partners/logos/pateway.png" alt="PatewayAI" width="150"></a></td> <td>Thanks to PatewayAI for sponsoring this project! PatewayAI is an API relay service provider built for heavy AI developers, focused on directly relaying official high-quality model APIs. It offers the full Claude lineup and the Codex series, 100% sourced from official channels — no dilution, no fakes, verification welcome. Billing is transparent and every token-level invoice can be audited line by line. It also supports enterprise-grade concurrency and provides a dedicated management platform for enterprise customers — formal contracts and invoicing are available; visit the official website for contact details. Register now via <a href="https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/">this link</a> to receive $3 in trial credit. Top-ups go as low as 60% of the original price, with a two-way referral bonus of up to $150!</td> </tr> <tr> <td width="180"><a href="https://teamorouter.com/?utm_source=cc_switch&utm_medium=referral&utm_campaign=ai_directory"><img src="assets/partners/logos/TeamoRouter-banner.png" alt="TeamoRouter" width="150"></a></td> <td>Thanks to TeamoRouter for sponsoring this project! TeamoRouter is an enterprise-grade Agentic LLM gateway built for developers, AI teams, and businesses. Without requiring any subscriptions, it lets you access Claude Code, Codex, Gemini CLI, OpenAI Codex, and other popular AI agents through a single unified API, while offering API pricing at discounts of up to 90%. Unlike typical API relay services, TeamoRouter aggregates hundreds of official model providers and trusted infrastructure partners, including OpenAI, Anthropic, Vertex, Azure, and AWS bedrock. Every provider is verified for 100% Agent protocol compatibility, cache performance, and request traceability, ensuring stable quality instead of reverse-engineered or diluted endpoints. The platform delivers near-official TTFT, 99.6% SLA, enterprise-scale throughput up to 5,000 QPM, and industry-leading cache hit rates that dramatically reduce token costs for long-running agent workflows. TeamoRouter also offers enterprise features including centralized billing, team management, BYOK, smart routing, usage analytics, dynamic provider optimization, and dedicated support. For an even simpler experience, Teamo Desktop lets you use Claude Code, Codex, Gemini CLI, and other popular AI agents with one-click setup—no API key management or manual gateway configuration required. Register via <a href="https://teamorouter.com/?utm_source=cc_switch&utm_medium=referral&utm_campaign=ai_directory">this link</a> as a new user to receive 10% off your first top-up.</td> </tr> <tr> <td width="180"><a href="https://zetaapi.ai/go/ccs"><img src="assets/partners/logos/zetaapi-banner.png" alt="ZetaAPI" width="150"></a></td> <td>Thanks to ZetaAPI for sponsoring this project! ZetaAPI focuses on real model fidelity, no watered-down responses, no quality degradation, and pricing as low as 35% of official rates. The platform does not mix traffic, secretly replace models with lower-quality alternatives, or use fake model routing. It supports Claude Code, Codex, Gemini, ChatGPT, and other mainstream AI models, helping users significantly reduce API costs while maintaining reliable model quality. At the same time, ZetaAPI provides enterprise-grade SLA-backed stability, standard API compatibility, one API key for multiple models, fast integration, and pay-as-you-go billing, making it suitable for AI products, coding agents, internal business tools, customer service systems, content generation, and automation workflows. If any model is verified to be inconsistent with its stated quality, ZetaAPI backs it with a 10x compensation guarantee, giving users a more stable, transparent, and trustworthy experience. Register via <a href="https://zetaapi.ai/go/ccs">this link</a> and use the promo code CC-SWITCH during your first recharge to enjoy an exclusive 10% discount on your first top-up, just for CC Switch users!</td> </tr> <tr> <td width="180"><a href="https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch"><img src="assets/partners/logos/byteplus.png" alt="BytePlus" width="150"></a></td> <td>Thanks to Dola seed for sponsoring this project! Dola Seed 2.0 is a full‑modal general large model independently developed by ByteDance for the global market. Built on a unified multimodal architecture, it supports joint understanding and generation of text, images, audio, and video. It natively enables agent collaboration, with strong reasoning, long‑task execution, tool integration, and coding capabilities. It is widely applicable to smart cockpits, personal assistants, education, customer support, marketing, retail, and other scenarios. It excels in multimodal perception, end‑to‑end complex task delivery, stable interaction, and data security, and is readily accessible and deployable via the ModelArk platform.Register via <a href="https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch">this link</a> to get 500,000 tokens of free inference quota per model.<a href="https://www.volcengine.com/activity/ai618?utm_campaign=hw&utm_content=hw&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch"> >>中国大陆地区的开发者请点击这里</a></td> </tr> <tr> <td width="180"><a href="https://cloud.siliconflow.cn/i/YflgU2Ve"><img src="assets/partners/logos/silicon_en.jpg" alt="SiliconFlow" width="150"></a></td> <td>Thanks to SiliconFlow for sponsoring this project! SiliconFlow is a high-performance AI infrastructure and model API platform, providing fast and reliable access to language, speech, image, and video models in one place. With pay-as-you-go billing, broad multimodal model support, high-speed inference, and enterprise-grade stability, SiliconFlow helps developers and teams build and scale AI applications more efficiently. Register via <a href="https://cloud.siliconflow.cn/i/YflgU2Ve">this link</a> and complete real-name verification to receive ¥16 in bonus credit, usable across models on the platform. SiliconFlow is also now compatible with OpenClaw, allowing users to connect a SiliconFlow API key and call major AI models for free.</td> </tr> <tr> <td width="180"><a href="https://cubence.com/signup?code=CCSWITCH&source=ccs"><img src="assets/partners/logos/cubence.png" alt="Cubence" width="150"></a></td> <td>Thanks to Cubence for sponsoring this project! Cubence is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more with flexible billing options including pay-as-you-go and monthly plans. Cubence provides special discounts for CC Switch users: register using <a href="https://cubence.com/signup?code=CCSWITCH&source=ccs">this link</a> and enter the "CCSWITCH" promo code during recharge to get 10% off every top-up!</td> </tr> <tr> <td width="180"><a href="https://www.dmxapi.cn/register?aff=bUHu"><img src="assets/partners/logos/dmx-en.jpg" alt="DMXAPI" width="150"></a></td> <td>Thanks to DMXAPI for sponsoring this project! DMXAPI provides global large model API services to 200+ enterprise users. One API key for all global models. Features include: instant invoicing, unlimited concurrency, starting from $0.15, 24/7 technical support. GPT/Claude/Gemini all at 32% off, domestic models 20-50% off, Claude Code exclusive models at 66% off! <a href="https://www.dmxapi.cn/register?aff=bUHu">Register here</a></td> </tr> <tr> <td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Compshare" width="150"></a></td> <td>Thanks to Compshare for sponsoring this project! Compshare is UCloud's AI cloud platform, providing stable and comprehensive domestic and international model APIs with just one key. Featuring cost-effective monthly and per-use domestic-model Coding Plan packages, alongside stable officially-relayed overseas models. Supports Claude Code, Codex, and API access. Enterprise-grade high concurrency, 24/7 technical support, and self-service invoicing. Users who register via <a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch">this link</a> will receive a free 5 CNY platform trial credit!</td> </tr> <tr> <td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.png" alt="Crazyrouter" width="150"></a></td> <td>Thanks to Crazyrouter for sponsoring this project! Crazyrouter is a high-performance AI API aggregation platform — one API key for 300+ models including Claude Code, Codex, Gemini CLI, and more. All models at 55% of official pricing with auto-failover, smart routing, and unlimited concurrency. Crazyrouter offers an exclusive deal for CC Switch users: register via <a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch">this link</a> and contact customer support to claim <strong>$2 free credit</strong>, plus enter promo code `CCSWITCH` on your first top-up for an extra <strong>30% bonus credit</strong>! </td> </tr> <tr> <td width="180"><a href="https://www.right.codes/register?aff=CCSWITCH"><img src="assets/partners/logos/rightcode.jpg" alt="RightCode" width="150"></a></td> <td>Thank you to Right Code for sponsoring this project! Right Code reliably provides routing services for models such as Claude Code, Codex, and Gemini, with both pay-as-you-go and monthly subscription billing options available. Invoices are available upon top-up, and enterprise and team users can receive dedicated one-on-one support. Right Code also offers an exclusive discount for CC Switch users: register via <a href="https://www.right.codes/register?aff=CCSWITCH">this link</a>, and with every top-up you will receive pay-as-you-go credit equivalent to 5% of the amount paid.</td> </tr> <tr> <td width="180"><a href="https://www.sssaicode.com/register?ref=DCP0SM"><img src="assets/partners/logos/sssaicode.png" alt="SSSAiCode" width="150"></a></td> <td>Thanks to SSSAiCode for sponsoring this project! SSSAiCode is a stable and reliable API relay service, dedicated to providing stable, reliable, and affordable Claude and Codex model services, with same-day fast invoicing. SSSAiCode offers a special deal for CC Switch users: register via <a href="https://www.sssaicode.com/register?ref=DCP0SM">this link</a> to enjoy $10 extra credit on every top-up!</td> </tr> <tr> <td width="180"><a href="https://www.micuapi.ai/register?aff=aOYQ"><img src="assets/partners/logos/mikubanner.svg" alt="Micu" width="150"></a></td> <td>Thanks to Micu API for sponsoring this project! Micu API is a global LLM relay service provider dedicated to delivering the best cost-performance ratio with high stability. Backed by a registered enterprise for core assurance, eliminating any risk of service discontinuation, with fast official invoicing support! We champion "zero cost to try": top up from as low as ¥1 with no minimum, and get fee-free refunds anytime! Micu API offers an exclusive deal for CC Switch users: register via <a href="https://www.micuapi.ai/register?aff=aOYQ">this link</a> and enter promo code "ccswitch" when topping up to enjoy a <strong>10% discount</strong>!</td> </tr> <tr> <td width="180"><a href="https://etok.ai"><img src="assets/partners/logos/etok.png" alt="ETok" width="150"></a></td> <td>Thanks to ETok.ai for sponsoring this project! ETok.ai is dedicated to building a one-stop AI programming tool service platform. We offer professional Claude Code packages and technical community services, with support for Google Gemini and OpenAI Codex. Through carefully designed plans and a professional tech community, we provide developers with reliable service guarantees and continuous technical support, making AI-assisted programming a true productivity tool. Click <a href="https://etok.ai">here</a> to register!</td> </tr> <tr> <td width="180"><a href="https://console.claudeapi.com/register?aff=pCLD"><img src="assets/partners/logos/claudeapi.png" alt="ClaudeAPI" width="150"></a></td> <td>This project is sponsored by <a href="https://console.claudeapi.com/register?aff=pCLD">Claude API</a>. Direct Claude API access — connect Claude Code and Agent apps in 3 minutes. New users can claim a free trial credit.Powered by official Anthropic API keys + AWS Bedrock official channels. No reverse engineering, no model degradation. Full support for Opus / Sonnet / Haiku model lineup, with official capabilities preserved including Tool Use, 1M context window, and more. Built for Claude Code power users, Agent engineers, and enterprise engineering teams. Invoicing and dedicated team support available. Click <a href="https://console.claudeapi.com/register?aff=pCLD">here</a> to register!</td> </tr> <tr> <td width="180"><a href="https://code0.ai/agent/register/B2XHxGjGmRvqgznY"><img src="assets/partners/logos/code0.png" alt="code0.ai" width="150"></a></td> <td>Thanks to <a href="https://code0.ai/agent/register/B2XHxGjGmRvqgznY">code0.ai</a> for sponsoring this project! code0.ai is an AI coding service platform built for developers, supporting Claude Code, Codex, Gemini, and other mainstream AI coding capabilities. It helps individual developers and teams use AI Agents more stably and efficiently for coding, debugging, refactoring, and automation workflows. ccswitch users can contact customer support via the <a href="https://code0.ai/agent/register/B2XHxGjGmRvqgznY">code0.ai website</a> to claim test credits and experience a reliable AI coding service.</td> </tr> <tr> <td width="180"><a href="https://claudecn.top"><img src="assets/partners/logos/claudecn.jpg" alt="ClaudeCN" width="150"></a></td> <td>Thanks to ClaudeCN for sponsoring this project! ClaudeCN is an enterprise-grade AI gateway platform operated by a registered company. It delivers high-availability commercial API access to popular models including Claude, GPT, and DeepSeek, and is built around formal enterprise procurement workflows — corporate bank transfers, signed contracts, and full compliance. Register via <a href="https://claudecn.top">this link</a>!</td> </tr> <tr> <td width="180"><a href="https://runapi.co"><img src="assets/partners/logos/runapi.jpg" alt="RunAPI" width="150"></a></td> <td>Thanks to RunAPI for sponsoring this project! RunAPI is a high-performance and reliable AI model API gateway — one API key gives you access to 150+ mainstream models including OpenAI, Claude, Gemini, DeepSeek, and Grok, with prices as low as 10% of the official rate and excellent stability. It works seamlessly with Claude Code, OpenClaw, and other tools. Exclusive benefit for CC Switch users: register and contact customer support to claim a free ¥14 credit. Register via <a href="https://runapi.co">this link</a>!</td> </tr> <tr> <td width="180"><a href="https://apikey.fun/register?aff=CCSwitch"><img src="assets/partners/logos/apikey_banner.png" alt="APIKEY.FUN" width="150"></a></td> <td>Thanks to APIKEY.FUN for sponsoring this project! APIKEY.FUN is a professional enterprise-grade AI relay platform dedicated to providing stable, efficient, and low-cost AI model API access for enterprises and individual developers. The platform supports popular mainstream models such as Claude, OpenAI, and Gemini, with prices as low as 7% of official rates. Register through this project's <a href="https://apikey.fun/register?aff=CCSwitch">exclusive link</a> to enjoy an exclusive offer of up to <strong>permanent 5% off top-ups</strong>.</td> </tr> <tr> <td width="180"><a href="https://apinebula.com/02rw5X"><img src="assets/partners/logos/apinebula_banner.png" alt="APINebula" width="150"></a></td> <td>Thanks to APINEBULA for sponsoring this project! APINEBULA, an enterprise-grade AI aggregation platform under Galaxy Video Bureau, leverages extensive platform resources to provide developers, teams, and enterprises with stable, cost-effective access to large language model APIs. The platform integrates leading, full-powered models like Claude, GPT, and Gemini, allowing you to connect to the world's top AI models through a single API, with prices starting as low as 10% of the original cost. Designed for AI programming, Agent development, and business system integration, APINEBULA supports enterprise-grade high concurrency, formal contracts, corporate bank transfers, and invoicing services. APINEBULA provides special discounts for our software users: register using <a href="https://apinebula.com/02rw5X">this link</a> and enter the <strong>"ccswitch"</strong> promo code during your first recharge to get <strong>10% off</strong>.</td> </tr> <tr> <td width="180"><a href="https://www.atlascloud.ai/coding-plan?utm_source=github&utm_campaign=cc-switch"><img src="assets/partners/logos/atlascloud_banner.png" alt="Atlas Cloud" width="150"></a></td> <td>Atlas Cloud is a full-modal AI inference platform that gives developers a single AI API to access video generation, image generation, and LLM APIs. Instead of managing multiple vendor integrations, you connect once and get unified access to 300+ curated models across all modalities. Check out Atlas Cloud's new <a href="https://www.atlascloud.ai/coding-plan?utm_source=github&utm_campaign=cc-switch">coding plan</a> promotion for more budget-friendly API access!</td> </tr> <tr> <td width="180"><a href="https://www.ccsub.net/register?ref=Y6Z8DXEA"><img src="assets/partners/logos/ccsub.svg" alt="CCSub" width="150"></a></td> <td>Thanks to CCSub for sponsoring this project! CCSub is a stable, affordable AI API relay platform — your drop-in replacement for a Claude.ai subscription. One API key gives you access to Claude Opus 4.8, Sonnet, Haiku, GPT-5, Gemini, and DeepSeek at roughly 30% of direct API cost, with no VPN required from anywhere in the world. Compatible with Claude Code, Codex, Cursor, Cline, Continue, Windsurf, and all major AI coding tools. Register via <a href="https://www.ccsub.net/register?ref=Y6Z8DXEA">this link</a> and get $5 free credit on sign-up.</td> </tr> <tr> <td width="180"><a href="https://unity2.ai/register?source=ccs"><img src="assets/partners/logos/unity2.jpg" alt="Unity2.ai" width="150"></a></td> <td>Thanks to Unity2.ai for sponsoring this project! Unity2.ai is a high-performance AI model API relay platform for individual developers, teams, and enterprises. Long trusted by leading companies in China, it serves over 30 billion tokens per day and supports high concurrency at the 5,000 RPM level. It offers balance-based billing, first top-up bonuses, bundle subscriptions, corporate invoicing, and dedicated support. Register via <a href="https://unity2.ai/register?source=ccs">this link</a> to get $2 in credits, plus another $10 for joining the official group — up to $12 in free credits!</td> </tr> <tr> <td width="180"><a href="https://api.fenno.ai/register?redirect=/purchase?tab=subscription%26group=16&aff=P9MR3D3PLCNL"><img src="assets/partners/logos/fenno-banner.png" alt="Fenno.ai" width="150"></a></td> <td>Thanks to Fenno.ai for sponsoring this project! Fenno.ai is a stable and efficient API relay service provider, currently focused on Codex relay. It is compatible with the OpenAI and Anthropic protocols and can be flexibly used from Codex, Claude Code, OpenCode, and other mainstream coding tools. It reliably supports enterprise-grade workloads of hundreds of billions of tokens per day, with corporate (B2B) settlement and invoicing for both domestic and overseas entities. Fenno.ai offers an exclusive benefit for CC Switch users: subscribe via <a href="https://api.fenno.ai/register?redirect=/purchase?tab=subscription%26group=16&aff=P9MR3D3PLCNL">this link</a> to the incredible ¥9.9 Coding Plan worth $150 in credits, and earn up to 20% in referral rewards — invite more, earn more!</td> </tr> <tr> <td width="180"><a href="https://nekocode.ai?aff=CCSWITCH"><img src="assets/partners/logos/nekocode-banner.png" alt="NekoCode" width="150"></a></td> <td>Thanks to <a href="https://nekocode.ai?aff=CCSWITCH">NekoCode</a> for sponsoring this project! NekoCode provides developers with a stable, efficient, and reliable API relay service for Claude, Codex, and other AI models. With transparent pricing and flexible pay-as-you-go billing, it offers a simple and cost-effective way to access AI models. CC Switch users can enjoy an exclusive 10% discount: register via <a href="https://nekocode.ai?aff=CCSWITCH">this link</a> and enter promo code <code>cc-switch</code> during recharge to receive 10% off your top-up!</td> </tr> <tr> <td width="180"><a href="https://www.newapi.ai/"><img src="assets/partners/logos/newapi-banner.png" alt="new-api" width="150"></a></td> <td>Thanks to the open-source AI infrastructure project <a href="https://www.newapi.ai/">new-api</a> for its strong support of this project! new-api is an open-source AI infrastructure project from QuantumNous and one of the leading unified LLM access-and-distribution projects by activity and adoption, focused on helping developers, teams, and enterprises build manageable, scalable AI service platforms at lower cost. As a fellow project rooted in the open-source ecosystem, new-api hopes to sponsor and support the continued growth of more outstanding open-source projects. 🌟 Star new-api to show your support: <a href="https://github.com/QuantumNous/new-api">https://github.com/QuantumNous/new-api</a>. Website: <a href="https://www.newapi.ai/">https://www.newapi.ai/</a>.</td> </tr> <tr> <td width="180"><a href="https://subrouter.ai/register?aff=l3ri"><img src="assets/partners/logos/subrouter-banner.png" alt="SubRouter" width="150"></a></td> <td>Thanks to SubRouter for sponsoring this project! SubRouter is a marketplace and smart routing platform for AI service operators. Merchants can launch operating sites, publish packages, manage users, models, and pricing, while users discover services and access reliable AI models through one unified API. Register via <a href="https://subrouter.ai/register?aff=l3ri">this link</a>!</td> </tr> </table> </details> ## Why CC Switch? Modern AI-powered coding relies on tools like Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, and Hermes — but each has its own configuration format. Switching API providers means manually editing JSON, TOML, or `.env` files, and there is no unified way to manage MCP and Skills across multiple tools. **CC Switch** gives you a single desktop app to manage all supported AI tools. Instead of editing config files by hand, you get a visual interface to import providers with one click, switch between them instantly, with 50+ built-in provider presets, unified MCP and Skills management, and system tray quick switching — all backed by a reliable SQLite database with atomic writes that protect your configs from corruption. - **One App, Eight Tools** — Manage Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, and Hermes from a single interface - **No More Manual Editing** — 50+ provider presets including AWS Bedrock, NVIDIA NIM, and community relays; just pick and switch - **Unified MCP & Skills Management** — One panel to manage MCP servers and Skills across Claude, Codex, Gemini, Grok Build, OpenCode, and Hermes with bidirectional sync - **System Tray Quick Switch** — Switch providers instantly from the tray menu, no need to open the full app - **Cloud Sync** — Sync provider data across devices via Dropbox, OneDrive, iCloud, or WebDAV servers - **Cross-Platform** — Native desktop app for Windows, macOS, and Linux, built with Tauri 2 - **Built-in Utilities** — Includes various utilities for first-launch login confirmation, signature bypass, plugin extension sync, and more ## Screenshots | Main Interface | Add Provider | | :-----------------------------------------------: | :--------------------------------------------: | | ![Main Interface](assets/screenshots/main-en.png) | ![Add Provider](assets/screenshots/add-en.png) | ## Features [Full Changelog](CHANGELOG.md) | [Release Notes](docs/release-notes/v3.16.1-en.md) ### Provider Management - **8 supported tools, 50+ presets** — Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes; copy your key and import with one click - **Universal providers** — One config syncs to Claude Code, Codex, and Gemini CLI - One-click switching, system tray quick access, drag-and-drop sorting, import/export ### Proxy & Failover - **Local proxy with hot-switching** — Format conversion, auto-failover, circuit breaker, provider health monitoring, and request rectifier - **App-level takeover** — Independently proxy Claude, Codex, Gemini, or Grok Build, down to individual providers ### MCP, Prompts & Skills - **Unified MCP panel** — Manage MCP servers across Claude, Codex, Gemini, Grok Build, OpenCode, and Hermes with bidirectional sync and Deep Link import - **Prompts** — Markdown editor with cross-app sync (CLAUDE.md / AGENTS.md / GEMINI.md) and backfill protection - **Skills** — One-click install from GitHub repos or ZIP files, custom repository management, with symlink and file copy support ### Usage & Cost Tracking - **Usage dashboard** — Track spending, requests, and tokens with trend charts, detailed request logs, and custom per-model pricing ### Session Manager & Workspace - Browse, search, and restore conversation history across supported session sources - **Workspace editor** (OpenClaw) — Edit agent files (AGENTS.md, SOUL.md, etc.) with Markdown preview ### System & Platform - **Cloud sync** — Custom config directory (Dropbox, OneDrive, iCloud, NAS) and WebDAV server sync - **Deep Link** (`ccswitch://`) — Import providers, MCP servers, prompts, and skills via URL - Dark / Light / System theme, auto-launch, auto-updater, atomic writes, auto-backups, i18n (zh/zh-TW/en/ja) ## FAQ <details> <summary><strong>Which AI tools does CC Switch support?</strong></summary> CC Switch supports eight tools: **Claude Code**, **Claude Desktop**, **Codex**, **Gemini CLI**, **Grok Build**, **OpenCode**, **OpenClaw**, and **Hermes**. Each tool has dedicated provider presets and configuration management. </details> <details> <summary><strong>Do I need to restart the terminal after switching providers?</strong></summary> For most tools, yes — restart your terminal or the CLI tool for changes to take effect. The exception is **Claude Code**, which currently supports hot-switching of provider data without a restart. </details> <details> <summary><strong>My plugin configuration disappeared after switching providers — what happened?</strong></summary> CC Switch provides a "Shared Config Snippet" feature to pass common data (beyond API keys and endpoints) between providers. Go to "Edit Provider" → "Shared Config Panel" → click "Extract from Current Provider" to save all common data. When creating a new provider, check "Write Shared Config" (enabled by default) to include plugin data in the new provider. All your configuration items are preserved in the default provider imported when you first launched the app. </details> <details> <summary><strong>macOS installation</strong></summary> CC Switch for macOS is code-signed and notarized by Apple. You can download and install it directly — no extra steps needed. We recommend using the `.dmg` installer. </details> <details> <summary><strong>Why can't I delete the currently active provider?</strong></summary> CC Switch follows a "minimal intrusion" design principle — even if you uninstall the app, your CLI tools will continue to work normally. The system always keeps one active configuration, because deleting all configurations would make the corresponding CLI tool unusable. If you rarely use a specific CLI tool, you can hide it in Settings. To switch back to official login, see the next question. </details> <details> <summary><strong>How do I switch back to official login?</strong></summary> Add an official provider from the preset list. After switching to it, run the Log out / Log in flow, and then you can freely switch between the official provider and third-party providers. Codex supports switching between different official providers, making it easy to switch between multiple Plus or Team accounts. </details> <details> <summary><strong>Where is my data stored?</strong></summary> - **Database**: `~/.cc-switch/cc-switch.db` (SQLite — providers, MCP, prompts, skills) - **Local settings**: `~/.cc-switch/settings.json` (device-level UI preferences) - **Backups**: `~/.cc-switch/backups/` (auto-rotated, keeps 10 most recent) - **Skills**: `~/.cc-switch/skills/` (symlinked to corresponding apps by default) - **Skill Backups**: `~/.cc-switch/skill-backups/` (created automatically before uninstall, keeps 20 most recent) </details> <details> <summary><strong>Linux (Wayland + NVIDIA): clicks don't register and the window black-screens on resize</strong></summary> The AppImage forces `GDK_BACKEND=x11` (XWayland) to avoid a historical native-Wayland crash. On newer Wayland + NVIDIA setups this can leave the web content area unclickable (the title-bar buttons still work) and black-screen on resize. Launch with the opt-in escape hatch to switch back to native Wayland: ```bash CC_SWITCH_GDK_BACKEND=wayland ./CC-Switch-*.AppImage ``` If you launch from a desktop icon, add it to the `.desktop` `Exec=` line (e.g. `env CC_SWITCH_GDK_BACKEND=wayland /path/to/AppImage`) or set it in your session environment. The variable is generic: on tiling Wayland compositors (sway/Hyprland) where clicks don't register, try `CC_SWITCH_GDK_BACKEND=x11` instead. Leaving it unset keeps the default behavior. </details> ## Documentation For detailed guides on every feature, check out the **[User Manual](docs/user-manual/en/README.md)** — covering provider management, MCP/Prompts/Skills, proxy & failover, and more. ## Quick Start ### Basic Usage 1. **Add Provider**: Click "Add Provider" → Choose a preset or create custom configuration 2. **Switch Provider**: - Main UI: Select provider → Click "Enable" - System Tray: Click provider name directly (instant effect) 3. **Takes Effect**: Restart your terminal or the corresponding CLI tool to apply changes (Claude Code does not require a restart) 4. **Back to Official**: Add an "Official Login" preset, restart the CLI tool, then follow its login/OAuth flow ### MCP, Prompts, Skills & Sessions - **MCP**: Click the "MCP" button → Add servers via templates or custom config → Toggle per-app sync - **Prompts**: Click "Prompts" → Create presets with Markdown editor → Activate to sync to live files - **Skills**: Click "Skills" → Browse GitHub repos → One-click install to supported apps - **Sessions**: Click "Sessions" → Browse, search, and restore conversation history across supported session sources > **Note**: On first launch, you can manually import existing CLI tool configs as the default provider. ## Download & Installation ### System Requirements - **Windows**: Windows 10 and above - **macOS**: macOS 12 (Monterey) and above - **Linux**: Ubuntu 22.04+ / Debian 11+ / Fedora 34+ and other mainstream distributions ### Windows Users Download the latest `CC-Switch-v{version}-Windows.msi` installer or `CC-Switch-v{version}-Windows-Portable.zip` portable version from the [Releases](../../releases) page. ### macOS Users **Method 1: Install via Homebrew (Recommended)** ```bash brew install --cask cc-switch ``` Update: ```bash brew upgrade --cask cc-switch ``` **Method 2: Manual Download** Download `CC-Switch-v{version}-macOS.dmg` (recommended) or `.zip` from the [Releases](../../releases) page. > **Note**: CC Switch for macOS is code-signed and notarized by Apple. You can install and open it directly. ### Arch Linux Users **Install via paru (Recommended)** ```bash paru -S cc-switch-bin ``` ### Linux Users Download the latest Linux build from the [Releases](../../releases) page: - `CC-Switch-v{version}-Linux.deb` (Debian/Ubuntu) - `CC-Switch-v{version}-Linux.rpm` (Fedora/RHEL/openSUSE) - `CC-Switch-v{version}-Linux.AppImage` (Universal) > **Flatpak**: Not included in official releases. You can build it yourself from the `.deb` — see [`flatpak/README.md`](flatpak/README.md) for instructions. <details> <summary><strong>Architecture Overview</strong></summary> ### Design Principles ``` ┌─────────────────────────────────────────────────────────────┐ │ Frontend (React + TS) │ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │ │ Components │ │ Hooks │ │ TanStack Query │ │ │ │ (UI) │──│ (Bus. Logic) │──│ (Cache/Sync) │ │ │ └─────────────┘ └──────────────┘ └──────────────────┘ │ └────────────────────────┬────────────────────────────────────┘ │ Tauri IPC ┌────────────────────────▼────────────────────────────────────┐ │ Backend (Tauri + Rust) │ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │ │ Commands │ │ Services │ │ Models/Config │ │ │ │ (API Layer) │──│ (Bus. Layer) │──│ (Data) │ │ │ └─────────────┘ └──────────────┘ └──────────────────┘ │ └─────────────────────────────────────────────────────────────┘ ``` **Core Design Patterns** - **SSOT** (Single Source of Truth): All data stored in `~/.cc-switch/cc-switch.db` (SQLite) - **Dual-layer Storage**: SQLite for syncable data, JSON for device-level settings - **Dual-way Sync**: Write to live files on switch, backfill from live when editing active provider - **Atomic Writes**: Temp file + rename pattern prevents config corruption - **Concurrency Safe**: Mutex-protected database connection avoids race conditions - **Layered Architecture**: Clear separation (Commands → Services → DAO → Database) **Key Components** - **ProviderService**: Provider CRUD, switching, backfill, sorting - **McpService**: MCP server management, import/export, live file sync - **ProxyService**: Local proxy mode with hot-switching and format conversion - **SessionManager**: Conversation history browsing across supported session sources - **ConfigService**: Config import/export, backup rotation - **SpeedtestService**: API endpoint latency measurement </details> <details> <summary><strong>Development Guide</strong></summary> ### Environment Requirements - Node.js 18+ - pnpm 8+ - Rust 1.85+ - Tauri CLI 2.8+ ### Development Commands ```bash # Install dependencies pnpm install # Dev mode (hot reload) pnpm dev # Type check pnpm typecheck # Format code pnpm format # Check code format pnpm format:check # Run frontend unit tests pnpm test:unit # Run tests in watch mode (recommended for development) pnpm test:unit:watch # Build application pnpm build # Build debug version pnpm tauri build --debug ``` ### Rust Backend Development ```bash cd src-tauri # Format Rust code cargo fmt # Run clippy checks cargo clippy # Run backend tests cargo test # Run specific tests cargo test test_name # Run tests with test-hooks feature cargo test --features test-hooks ``` ### Testing Guide **Frontend Testing**: - Uses **vitest** as test framework - Uses **MSW (Mock Service Worker)** to mock Tauri API calls - Uses **@testing-library/react** for component testing **Running Tests**: ```bash # Run all tests pnpm test:unit # Watch mode (auto re-run) pnpm test:unit:watch # With coverage report pnpm test:unit --coverage ``` ### Tech Stack **Frontend**: React 18 · TypeScript · Vite · TailwindCSS 3.4 · TanStack Query v5 · react-i18next · react-hook-form · zod · shadcn/ui · @dnd-kit **Backend**: Tauri 2.8 · Rust · serde · tokio · thiserror · tauri-plugin-updater/process/dialog/store/log **Testing**: vitest · MSW · @testing-library/react </details> <details> <summary><strong>Project Structure</strong></summary> ``` ├── src/ # Frontend (React + TypeScript) │ ├── components/ │ │ ├── providers/ # Provider management │ │ ├── mcp/ # MCP panel │ │ ├── prompts/ # Prompts management │ │ ├── skills/ # Skills management │ │ ├── sessions/ # Session Manager │ │ ├── proxy/ # Proxy mode panel │ │ ├── openclaw/ # OpenClaw config panels │ │ ├── settings/ # Settings (Terminal/Backup/About) │ │ ├── deeplink/ # Deep Link import │ │ ├── env/ # Environment variable management │ │ ├── universal/ # Cross-app configuration │ │ ├── usage/ # Usage statistics │ │ └── ui/ # shadcn/ui component library │ ├── hooks/ # Custom hooks (business logic) │ ├── lib/ │ │ ├── api/ # Tauri API wrapper (type-safe) │ │ └── query/ # TanStack Query config │ ├── locales/ # Translations (zh/zh-TW/en/ja) │ ├── config/ # Presets (providers/mcp) │ └── types/ # TypeScript definitions ├── src-tauri/ # Backend (Rust) │ └── src/ │ ├── commands/ # Tauri command layer (by domain) │ ├── services/ # Business logic layer │ ├── database/ # SQLite DAO layer │ ├── proxy/ # Proxy module │ ├── session_manager/ # Session management │ ├── deeplink/ # Deep Link handling │ └── mcp/ # MCP sync module ├── tests/ # Frontend tests └── assets/ # Screenshots & partner resources ``` </details> ## Contributing Issues and suggestions are welcome! Before submitting PRs, please ensure: - Pass type check: `pnpm typecheck` - Pass format check: `pnpm format:check` - Pass unit tests: `pnpm test:unit` For new features, please open an issue for discussion before submitting a PR. PRs for features that are not a good fit for the project may be closed. ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=farion1231/cc-switch&type=Date)](https://www.star-history.com/#farion1231/cc-switch&Date) ## License MIT © Jason Young