Files
cc-switch/README.md

443 lines
17 KiB
Markdown
Raw Normal View History

Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
<div align="center">
# All-in-One Assistant for Claude Code, Codex & Gemini CLI
[![Version](https://img.shields.io/badge/version-3.7.1-blue.svg)](https://github.com/farion1231/cc-switch/releases)
[![Trending](https://img.shields.io/badge/🔥_TypeScript_Trending-Daily%20%7C%20Weekly%20%7C%20Monthly-ff6b6b.svg)](https://github.com/trending/typescript)
[![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/)
2025-11-12 21:52:47 +08:00
[![Downloads](https://img.shields.io/endpoint?url=https://api.pinstudios.net/api/badges/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>
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
English | [中文](README_ZH.md) | [Changelog](CHANGELOG.md)
**From Provider Switcher to All-in-One AI CLI Management Platform**
Unified management for Claude Code, Codex & Gemini CLI provider configurations, MCP servers, Skills extensions, and system prompts.
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
</div>
## ❤Sponsor
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
![Zhipu GLM](assets/partners/banners/glm-en.jpg)
This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN.
GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.6 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
Get 10% OFF the GLM CODING PLAN with [this link](https://z.ai/subscribe?ic=8JVLJQFSKB)!
---
<table>
<tr>
<td width="180"><img src="assets/partners/logos/packycode.png" alt="PackyCode" width="150"></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 recharge to get 10% off.</td>
</tr>
<tr>
<td width="180"><img src="assets/partners/logos/sds-en.png" alt="ShanDianShuo" width="150"></td>
2025-11-22 21:51:09 +08:00
<td>Thanks to ShanDianShuo for sponsoring this project! ShanDianShuo is a local-first AI voice input: Millisecond latency, data stays on device, 4x faster than typing, AI-powered correction, Privacy-first, completely free. Doubles your coding efficiency with Claude Code! <a href="https://www.shandianshuo.cn">Free download</a> for Mac/Win</td>
</tr>
</table>
2025-08-06 23:18:09 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Screenshots
| Main Interface | Add Provider |
| :-----------------------------------------------: | :--------------------------------------------: |
| ![Main Interface](assets/screenshots/main-en.png) | ![Add Provider](assets/screenshots/add-en.png) |
## Features
### Current Version: v3.7.0 | [Full Changelog](CHANGELOG.md) | [📋 Release Notes](docs/release-note-v3.7.0-en.md)
**v3.7.0 Major Update (2025-11-19)**
**Six Core Features, 18,000+ Lines of New Code**
- **Gemini CLI Integration**
- Third supported AI CLI (Claude Code / Codex / Gemini)
- Dual-file configuration support (`.env` + `settings.json`)
- Complete MCP server management
- Presets: Google Official (OAuth) / PackyCode / Custom
- **Claude Skills Management System**
- Auto-scan skills from GitHub repositories (3 pre-configured curated repos)
- One-click install/uninstall to `~/.claude/skills/`
- Custom repository support + subdirectory scanning
- Complete lifecycle management (discover/install/update)
- **Prompts Management System**
- Multi-preset system prompt management (unlimited presets, quick switching)
- Cross-app support (Claude: `CLAUDE.md` / Codex: `AGENTS.md` / Gemini: `GEMINI.md`)
- Markdown editor (CodeMirror 6 + real-time preview)
- Smart backfill protection, preserves manual modifications
- **MCP v3.7.0 Unified Architecture**
- Single panel manages MCP servers across three applications
- New SSE (Server-Sent Events) transport type
- Smart JSON parser + Codex TOML format auto-correction
- Unified import/export + bidirectional sync
- **Deep Link Protocol**
- `ccswitch://` protocol registration (all platforms)
- One-click import provider configs via shared links
- Security validation + lifecycle integration
- **Environment Variable Conflict Detection**
- Auto-detect cross-app configuration conflicts (Claude/Codex/Gemini/MCP)
- Visual conflict indicators + resolution suggestions
- Override warnings + backup before changes
**Core Capabilities**
- **Provider Management**: One-click switching between Claude Code, Codex, and Gemini API configurations
- **Speed Testing**: Measure API endpoint latency with visual quality indicators
- **Import/Export**: Backup and restore configs with auto-rotation (keep 10 most recent)
- **i18n Support**: Complete Chinese/English localization (UI, errors, tray)
- **Claude Plugin Sync**: One-click apply/restore Claude plugin configurations
2025-08-06 23:18:09 +08:00
**v3.6 Highlights**
2025-08-06 23:18:09 +08:00
- Provider duplication & drag-and-drop sorting
- Multi-endpoint management & custom config directory (cloud sync ready)
- Granular model configuration (4-tier: Haiku/Sonnet/Opus/Custom)
- WSL environment support with auto-sync on directory change
- 100% hooks test coverage & complete architecture refactoring
**System Features**
- System tray with quick switching
- Single instance daemon
- Built-in auto-updater
- Atomic writes with rollback protection
2025-08-06 23:18:09 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Download & Installation
### System Requirements
- **Windows**: Windows 10 and above
- **macOS**: macOS 10.15 (Catalina) 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 tap farion1231/ccswitch
brew install --cask cc-switch
```
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
Update:
```bash
brew upgrade --cask cc-switch
```
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
**Method 2: Manual Download**
Download `CC-Switch-v{version}-macOS.zip` from the [Releases](../../releases) page and extract to use.
> **Note**: Since the author doesn't have an Apple Developer account, you may see an "unidentified developer" warning on first launch. Please close it first, then go to "System Settings" → "Privacy & Security" → click "Open Anyway", and you'll be able to open it normally afterwards.
### ArchLinux 用户
**Install via paru (Recommended)**
```bash
paru -S cc-switch-bin
```
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
### Linux Users
Download the latest `CC-Switch-v{version}-Linux.deb` package or `CC-Switch-v{version}-Linux.AppImage` from the [Releases](../../releases) page.
## Quick Start
### Basic Usage
1. **Add Provider**: Click "Add Provider" → Choose 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 Claude Code / Codex / Gemini clients to apply changes
4. **Back to Official**: Select the "Official Login" preset (Claude/Codex) or "Google Official" preset (Gemini), restart the corresponding client, then follow its login/OAuth flow
### MCP Management
2025-08-06 23:18:09 +08:00
- **Location**: Click "MCP" button in top-right corner
- **Add Server**:
- Use built-in templates (mcp-fetch, mcp-filesystem, etc.)
- Support stdio / http / sse transport types
- Configure independent MCP servers for different apps
- **Enable/Disable**: Toggle switches to control which servers sync to live config
- **Sync**: Enabled servers auto-sync to each app's live files
- **Import/Export**: Import existing MCP servers from Claude/Codex/Gemini config files
### Skills Management (v3.7.0 New)
- **Location**: Click "Skills" button in top-right corner
- **Discover Skills**:
- Auto-scan pre-configured GitHub repositories (Anthropic official, ComposioHQ, community, etc.)
- Add custom repositories (supports subdirectory scanning)
- **Install Skills**: Click "Install" to one-click install to `~/.claude/skills/`
- **Uninstall Skills**: Click "Uninstall" to safely remove and clean up state
- **Manage Repositories**: Add/remove custom GitHub repositories
### Prompts Management (v3.7.0 New)
- **Location**: Click "Prompts" button in top-right corner
- **Create Presets**:
- Create unlimited system prompt presets
- Use Markdown editor to write prompts (syntax highlighting + real-time preview)
- **Switch Presets**: Select preset → Click "Activate" to apply immediately
- **Sync Mechanism**:
- Claude: `~/.claude/CLAUDE.md`
- Codex: `~/.codex/AGENTS.md`
- Gemini: `~/.gemini/GEMINI.md`
- **Protection Mechanism**: Auto-save current prompt content before switching, preserves manual modifications
2025-08-06 23:18:09 +08:00
### Configuration Files
**Claude Code**
- Live config: `~/.claude/settings.json` (or `claude.json`)
- API key field: `env.ANTHROPIC_AUTH_TOKEN` or `env.ANTHROPIC_API_KEY`
- MCP servers: `~/.claude.json``mcpServers`
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
**Codex**
- Live config: `~/.codex/auth.json` (required) + `config.toml` (optional)
- API key field: `OPENAI_API_KEY` in `auth.json`
fix(mcp): correct Codex MCP configuration format to [mcp_servers] BREAKING CHANGE: The [mcp.servers] format was completely incorrect and not any official Codex format. The only correct format is [mcp_servers] at the top level of config.toml. Changes: - Remove incorrect [mcp.servers] nested table support - Always use [mcp_servers] top-level table (official Codex format) - Auto-migrate and cleanup erroneous [mcp.servers] entries on write - Preserve error-tolerant import for migrating old incorrect configs - Simplify sync logic by removing format selection branches (~60 lines) - Update all documentation and tests to reflect correct format - Add warning logs when detecting and cleaning incorrect format Backend (Rust): - mcp.rs: Simplify sync_enabled_to_codex by removing Target enum - mcp.rs: sync_single_server_to_codex now always uses [mcp_servers] - mcp.rs: remove_server_from_codex cleans both locations - mcp.rs: Update import_from_codex comments to clarify format status - tests: Rename test to sync_enabled_to_codex_migrates_erroneous_* - tests: Update assertions to verify migration behavior Frontend (TypeScript): - tomlUtils.ts: Prioritize [mcp_servers] format in parsing - tomlUtils.ts: Update error messages to guide correct format Documentation: - README.md: Correct MCP format reference to [mcp_servers] - CLAUDE.md: Add comprehensive format specification with examples All 79 tests pass. This ensures backward compatibility while enforcing the correct Codex official standard going forward. Refs: https://github.com/openai/codex/issues/3441
2025-11-17 22:57:04 +08:00
- MCP servers: `~/.codex/config.toml``[mcp_servers]` tables
**Gemini**
- Live config: `~/.gemini/.env` (API key) + `~/.gemini/settings.json` (auth mode)
- API key field: `GEMINI_API_KEY` or `GOOGLE_GEMINI_API_KEY` in `.env`
- Environment variables: Support `GOOGLE_GEMINI_BASE_URL`, `GEMINI_MODEL`, etc.
- MCP servers: `~/.gemini/settings.json``mcpServers`
- Tray quick switch: Each provider switch rewrites `~/.gemini/.env`, no need to restart Gemini CLI
**CC Switch Storage**
2025-08-04 22:16:26 +08:00
- Main config (SSOT): `~/.cc-switch/config.json` (includes providers, MCP, Prompts presets, etc.)
- Settings: `~/.cc-switch/settings.json`
- Backups: `~/.cc-switch/backups/` (auto-rotate, keep 10)
### Cloud Sync Setup
2025-09-01 15:33:24 +08:00
1. Go to Settings → "Custom Configuration Directory"
2. Choose your cloud sync folder (Dropbox, OneDrive, iCloud, etc.)
3. Restart app to apply
4. Repeat on other devices to enable cross-device sync
2025-09-01 15:33:24 +08:00
> **Note**: First launch auto-imports existing Claude/Codex configs as default provider.
## Architecture Overview
### 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 provider configs stored in `~/.cc-switch/config.json`
- **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**: RwLock with scoped guards avoids deadlocks
- **Layered Architecture**: Clear separation (Commands → Services → Models)
**Key Components**
- **ProviderService**: Provider CRUD, switching, backfill, sorting
- **McpService**: MCP server management, import/export, live file sync
- **ConfigService**: Config import/export, backup rotation
- **SpeedtestService**: API endpoint latency measurement
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
**v3.6 Refactoring**
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
- Backend: 5-phase refactoring (error handling → command split → tests → services → concurrency)
- Frontend: 4-stage refactoring (test infra → hooks → components → cleanup)
- Testing: 100% hooks coverage + integration tests (vitest + MSW)
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Development
2025-08-04 22:16:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
### Environment Requirements
- Node.js 18+
- pnpm 8+
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
- Rust 1.85+
- Tauri CLI 2.8+
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
### Development Commands
2025-08-04 22:16:26 +08:00
```bash
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Install dependencies
2025-08-06 23:18:09 +08:00
pnpm install
2025-08-04 22:16:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Dev mode (hot reload)
pnpm dev
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Type check
pnpm typecheck
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Format code
pnpm format
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Check code format
pnpm format:check
2025-08-04 22:16:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Run frontend unit tests
pnpm test:unit
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Run tests in watch mode (recommended for development)
pnpm test:unit:watch
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Build application
pnpm build
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Build debug version
pnpm tauri build --debug
```
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
### Rust Backend Development
```bash
cd src-tauri
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Format Rust code
cargo fmt
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Run clippy checks
cargo clippy
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Run backend tests
cargo test
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
# Run specific tests
cargo test test_name
# Run tests with test-hooks feature
cargo test --features test-hooks
2025-08-04 22:16:26 +08:00
```
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
### Testing Guide (v3.6 New)
**Frontend Testing**:
2025-08-04 22:16:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
- Uses **vitest** as test framework
- Uses **MSW (Mock Service Worker)** to mock Tauri API calls
- Uses **@testing-library/react** for component testing
2025-08-06 23:18:09 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
**Test Coverage**:
2025-08-06 23:18:09 +08:00
- Hooks unit tests (100% coverage)
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
- `useProviderActions` - Provider operations
- `useMcpActions` - MCP management
- `useSettings` series - Settings management
- `useImportExport` - Import/export
- Integration tests
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
- App main application flow
- SettingsDialog complete interaction
- MCP panel functionality
**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
2025-08-06 23:18:09 +08:00
```
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Tech Stack
**Frontend**: React 18 · TypeScript · Vite · TailwindCSS 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
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Project Structure
```
├── src/ # Frontend (React + TypeScript)
│ ├── components/ # UI components (providers/settings/mcp/ui)
│ ├── hooks/ # Custom hooks (business logic)
│ ├── lib/
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
│ │ ├── api/ # Tauri API wrapper (type-safe)
│ │ └── query/ # TanStack Query config
│ ├── i18n/locales/ # Translations (zh/en)
│ ├── config/ # Presets (providers/mcp)
│ └── types/ # TypeScript definitions
├── src-tauri/ # Backend (Rust)
│ └── src/
│ ├── commands/ # Tauri command layer (by domain)
│ ├── services/ # Business logic layer
│ ├── app_config.rs # Config data models
│ ├── provider.rs # Provider domain models
│ ├── mcp.rs # MCP sync & validation
│ └── lib.rs # App entry & tray menu
├── tests/ # Frontend tests
│ ├── hooks/ # Unit tests
│ └── components/ # Integration tests
└── assets/ # Screenshots & partner resources
2025-08-06 23:18:09 +08:00
```
2025-08-04 22:16:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for version update details.
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Legacy Electron Version
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
[Releases](../../releases) retains v2.0.3 legacy Electron version
2025-08-29 15:37:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
If you need legacy Electron code, you can pull the electron-legacy branch
2025-08-29 15:37:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
## Contributing
2025-08-29 15:37:26 +08:00
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
Issues and suggestions are welcome!
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
Before submitting PRs, please ensure:
Release v3.6.0: Major architecture refactoring and feature enhancements New Features: - Provider duplication and manual sorting via drag-and-drop - Custom endpoint management for aggregator providers - Usage query with auto-refresh interval and test script API - Config editor improvements (JSON format button, real-time TOML validation) - Auto-sync on directory change for WSL environment support - Load live config when editing active provider to protect manual modifications - New provider presets: DMXAPI, Azure Codex, AnyRouter, AiHubMix, MiniMax - Partner promotion mechanism (Zhipu GLM Z.ai) Architecture Improvements: - Backend: 5-phase refactoring (error handling → command split → services → concurrency) - Frontend: 4-stage refactoring (tests → hooks → components → cleanup) - Testing: 100% hooks unit test coverage, integration tests for critical flows Documentation: - Complete README rewrite with detailed architecture overview - Separate Chinese (README_ZH.md) and English (README.md) versions - Comprehensive v3.6.0 changelog with categorized changes - New bilingual screenshots and partner banners Bug Fixes: - Fixed configuration sync issues (apiKeyUrl priority, MCP sync, import sync) - Fixed usage query interval timing and refresh button animation - Fixed UI issues (edit mode alignment, language switch state) - Fixed endpoint speed test and provider duplicate insertion position - Force exit on config error to prevent silent fallback Technical Details: - Updated to Tauri 2.8.x, TailwindCSS 4.x, TanStack Query v5.90.x - Removed legacy v1 migration logic for better startup performance - Standardized command parameters (unified to camelCase `app`) - Result pattern for graceful error handling
2025-11-07 16:27:51 +08:00
- 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
2025-09-15 21:49:32 +08:00
## 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)
2025-08-04 22:16:26 +08:00
## License
MIT © Jason Young