feat: Enable CC Switch to recognize Hermes as the sixth AppType and be able to read and write its configuration file for switching#2120
Conversation
### Done - [x] Comprehensive frontend type updates (AppId, AppType, etc.) - [x] UI integration for Hermes in sidebar and settings - [x] i18n support for English, Chinese, and Japanese - [x] Verified backend configuration logic with unit tests - [x] Fixed all TypeScript type errors related to Hermes integration ### Pending - [ ] Database migration for 'enabled_hermes' field in 'mcp_servers' and 'skills' tables - [ ] Implementation of Hermes-specific MCP sync logic in services/mcp.rs - [ ] Dedicated Hermes application icon --- ### 已完成 - [x] 全面的前端类型更新(AppId, AppType 等) - [x] 侧边栏及设置页面的 Hermes UI 集成 - [x] 中、英、日三语的 i18n 支持 - [x] 通过单元测试验证了后端配置逻辑 - [x] 修复了所有与 Hermes 集成相关的 TypeScript 类型错误 ### 待处理 - [ ] 数据库 Schema 迁移(为 mcp_servers 和 skills 表增加 enabled_hermes 字段) - [ ] 实现 Hermes 专用的 MCP 同步逻辑 - [ ] 增加 Hermes 专用应用图标
|
Hi @CodeGetters, I've implemented the missing frontend parts and fixed all TypeScript type errors for Hermes support. I've also verified the backend logic with unit tests. I've submitted a PR to your fork here: https://github.com/CodeGetters/cc-switch/pull/1 Done
Pending
Feel free to merge the PR in your fork to update this main PR! 你好 @CodeGetters,我为您补全了 Hermes 支持中缺失的前端部分,并修复了所有的 TypeScript 类型错误。我也通过单元测试验证了后端的配置读写逻辑。 我已经向您的 Fork 仓库发起了 PR:https://github.com/CodeGetters/cc-switch/pull/1 欢迎将该 PR 合并到您的分支中,以更新此主仓库的 Pull Request! |
feat: complete frontend integration for Hermes support
|
hi @chan-yuu I have merged this part of the content and solve the duplicate declarations after merge. Thank you for your contribution. I sincerely hope that we can complete this PR quickly! |
…ictures on the Settings page
- Add build_hermes_settings() in deeplink with correct snake_case format - Implement sync_hermes_live() in ConfigService (previously placeholder) - Add check_hermes_stream() for stream health checks - Fix model extraction to read from settings_config.model field - Remove duplicate i18n entries
CodeGetters
left a comment
There was a problem hiding this comment.
概述
将 Hermes 作为第 6 个 AppType 集成到 CC Switch,实现 Provider 配置与 ~/.hermes/config.yaml 的双向同步。
核心功能
1. Provider 配置同步
| 操作 | 行为 |
|---|---|
| 新增 Provider | 写入 custom_providers 列表 + 更新 model.provider/default |
| 切换 Provider | 更新 model.provider 和 model.default |
| 删除 Provider | 从 custom_providers 中移除(不可删除当前 provider) |
| 导入 | 从 custom_providers 读取当前激活的 provider |
配置文件结构 (~/.hermes/config.yaml):
model:
default: claude-sonnet-4-6
provider: "My Provider"
custom_providers:
- name: "My Provider"
base_url: "https://api.example.com/v1"
api_key: "sk-xxx"
model: "claude-sonnet-4-6"
transport: "openai_chat"2. MCP 同步支持
- 支持
mcp_servers字段读写 - 统一 MCP 管理面板集成 Hermes
3. 前端完整集成
- Hermes Provider 表单组件
- 预设配置:Anthropic Official, OpenRouter, Custom
- App Switcher 支持 Hermes 切换
- 代理面板集成
|
I'm adding some key information: 关键实现后端 Rust
// 读取配置
pub fn read_hermes_config() -> Result<serde_yaml::Value, AppError>
pub fn read_hermes_live_settings() -> Result<JsonValue, AppError>
// 写入配置
pub fn write_hermes_live(provider: &Provider) -> Result<(), AppError>
pub fn write_hermes_config_atomic(yaml: &serde_yaml::Value) -> Result<(), AppError>
// 删除 Provider
pub fn remove_hermes_provider_from_live(provider_name: &str) -> Result<(), AppError>
// 切换当前 Provider
pub fn set_current_hermes_provider(provider_name: &str, model: Option<&str>) -> Result<(), AppError>
pub fn sync_enabled_to_hermes(config: &MultiAppConfig) -> Result<(), AppError>
pub fn import_from_hermes(config: &mut MultiAppConfig) -> Result<usize, AppError>
pub fn sync_single_server_to_hermes(config: &MultiAppConfig, id: &str, server_spec: &Value) -> Result<(), AppError>
pub fn remove_server_from_hermes(id: &str) -> Result<(), AppError>前端 React配置格式 (蛇形命名,匹配后端): interface HermesSettingsConfig {
name: string; // Provider 名称
model: string; // 模型名称
base_url: string; // API 端点
api_key: string; // API 密钥
transport: string; // 传输类型,默认 "openai_chat"
}测试覆盖
|
|
hi @chan-yuu , I have implemented most of the functions. Please remember to check if there is any repetitive development content to avoid opening. Also, you are welcome to pull the latest code.🥰 |
|
hi @farion1231 ,do you have time to review this pr? Could support for hermes be launched as soon as possible? After all, there are also many people using hermes nowadays.🥰 |
|
Actually, I’ve been working on adding support for Hermes Agent recently.
It’s turned out to be more work than I expected, because Hermes Agent is
still not very mature, especially when it comes to its support for the
third-party Anthropic Messages format. I believe it should be finished and
released within the next two or three days.
Simon Johnson ***@***.***> 于2026年4月19日周日 16:12写道:
… *CodeGetters* left a comment (farion1231/cc-switch#2120)
<#2120?email_source=notifications&email_token=AKW3RFHCCY75E2UAXP6YDGL4WSC7ZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRXGU2DQNZYGQ42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4275487849>
hi @farion1231 <https://github.com/farion1231> ,do you have time to
review this pr? Could support for hermes be launched as soon as possible?
After all, there are also many people using hermes nowadays.🥰
—
Reply to this email directly, view it on GitHub
<#2120?email_source=notifications&email_token=AKW3RFHCCY75E2UAXP6YDGL4WSC7ZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRXGU2DQNZYGQ42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4275487849>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKW3RFGIDNKFQS53IDGQHPD4WSC7ZAVCNFSM6AAAAACX23HP3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DENZVGQ4DOOBUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I'm very glad to hear such words. I'm looking forward to the latest version.🤩 |
provider
Summary / 概述
Enable CC Switch to recognize Hermes as the sixth AppType and be able to read and write its configuration file for switching
Related Issue / 关联 Issue
Fixes #2113
Screenshots / 截图
|


|
|
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)