{"id":49758265,"url":"https://github.com/huangbogeng/cc-switch-ui","last_synced_at":"2026-05-11T00:29:36.160Z","repository":{"id":354553129,"uuid":"1223287429","full_name":"huangbogeng/cc-switch-ui","owner":"huangbogeng","description":"Using CC Switch on systems without a desktop environment, like Linux servers or cloud servers.","archived":false,"fork":false,"pushed_at":"2026-05-07T03:09:02.000Z","size":349,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T04:19:15.879Z","etag":null,"topics":["cc-switch","claude-code","web-ui"],"latest_commit_sha":null,"homepage":"https://github.com/huangbogeng/cc-switch-ui","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huangbogeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T07:18:48.000Z","updated_at":"2026-05-07T02:12:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/huangbogeng/cc-switch-ui","commit_stats":null,"previous_names":["huangbogeng/cc-switch-ui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huangbogeng/cc-switch-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangbogeng%2Fcc-switch-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangbogeng%2Fcc-switch-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangbogeng%2Fcc-switch-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangbogeng%2Fcc-switch-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huangbogeng","download_url":"https://codeload.github.com/huangbogeng/cc-switch-ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangbogeng%2Fcc-switch-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32876335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cc-switch","claude-code","web-ui"],"created_at":"2026-05-11T00:29:27.680Z","updated_at":"2026-05-11T00:29:36.149Z","avatar_url":"https://github.com/huangbogeng.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CC Switch UI\n\n**Managing Claude Code Provider configurations has never been easier.**\n\n[![Version](https://img.shields.io/badge/version-0.1.0-blue)](https://github.com/huangbogeng/cc-switch-ui)\n[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/huangbogeng/cc-switch-ui)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n[**中文文档**](README_zh.md)\n\n---\n\n## 🎯 What It Solves\n\nConfiguring API Providers for Claude Code traditionally requires manually editing JSON files, memorizing various API endpoints, and handling complex OAuth authorization flows. \n\n**CC Switch Web allows you to manage all of this effortlessly within your browser:**\n\n- **One-click Provider Switching:** Instantly switch between different model providers without ever touching a config file.\n- **Built-in Presets:** Comes with 6 pre-configured popular providers (MiniMax, SiliconFlow, DeepSeek, OpenRouter, Gemini Native, Codex).\n- **Dual Authentication Support:** Supports both API Key and OAuth authentication flows.\n- **Real-time Live Sync:** Changes are immediately synchronized with your local Claude Code configuration and take effect instantly.\n\n---\n\n## 📌 Project Status (2026-05-08)\n\n- Backend crate rename completed: `cc-switch-web` -\u003e `cc-switch-server`.\n- Backend modularization Phase 0 and Phase 1 completed.\n- Proxy streaming pipeline is now modularized under `cc-switch-server/src/proxy/streaming/`:\n  - `openai_chat.rs`\n  - `responses.rs`\n  - `common.rs`\n  - `tool_blocks.rs`\n  - `finalization.rs`\n- Current focus: Phase 2 (`forwarder.rs` decomposition) while avoiding over-fragmented files.\n\n---\n\n## 🚀 Supported Providers\n\n| Provider | Type | Auth Method | Description |\n|----------|------|-------------|-------------|\n| **MiniMax** | Official | API Key | MiniMax M2.7 Model |\n| **SiliconFlow** | Aggregator | API Key | Supports various models |\n| **DeepSeek** | Official | API Key | DeepSeek V4 Model |\n| **OpenRouter** | Aggregator | API Key | 100+ Models available |\n| **Gemini Native**| Google | API Key | Native Gemini API |\n| **Codex** | OpenAI | OAuth | Proxied via local server |\n\n---\n\n## 🏁 Quick Start\n\n### Easy Installation (Linux \u0026 macOS)\n\nThe easiest way to install CC Switch UI is using our installation script:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/huangbogeng/cc-switch-ui/main/install.sh | bash\n```\n\nAfter installation, simply run:\n\n```bash\ncc-switch-ui\n```\n\nThe installer places the application under `~/.local/share/cc-switch-ui` by default. User data stays in `~/.cc-switch`, including the SQLite database.\n\n### CLI Commands\n\n`cc-switch-ui start` launches the backend server and serves frontend static assets (`/ui`) in one process (production mode).\n\n```bash\n# Start with defaults: 0.0.0.0:5007, proxy 15721\ncc-switch-ui start\n\n# Custom bind/proxy ports\ncc-switch-ui start --host 127.0.0.1 --port 5007 --proxy-port 15721\n\n# Health check\ncc-switch-ui status\n\n# Show version\ncc-switch-ui version\n\n# Diagnose installation/path/permission issues\ncc-switch-ui doctor\n```\n\n### Build from Source\n\nIf you prefer to build from source:\n\n```bash\n# Build frontend assets first (required for /ui in production mode)\ncd cc-switch-ui \u0026\u0026 npm ci \u0026\u0026 npm run build \u0026\u0026 cd ..\n\n# Build and run CLI entrypoint\ncargo build --release\ncargo run -p cc-switch-cli -- start\n```\n\n### 2. Access the Web UI\n\nOpen your browser and navigate to: **http://localhost:5007/ui**\n\n*(Note: An admin token is required for the first login, which can be found printed in your terminal startup logs.)*\n\n### 3. Add a Provider\n\n1. Go to the **Providers** page in the dashboard.\n2. Select a preset or configure a custom endpoint.\n3. Enter your API Key.\n4. Click **Save** and switch to it.\n\nClaude Code will immediately start using the new Provider you selected.\n\n---\n\n## ✨ Features\n\n### 🔌 Provider Management\n- 6 built-in Provider presets for quick setup.\n- Support for custom Provider configurations.\n- One-click switching with real-time configuration sync.\n\n### 🔑 OAuth Authentication\n- **Codex**: Forward OAuth requests securely via the local proxy.\n- **GitHub Copilot**: OAuth authentication *(Currently in development)*.\n\n### 🌐 Local Proxy Server\n- Built-in local proxy service to handle Codex requests.\n- Supports both HTTP and SOCKS5 proxy configurations.\n- Handles streaming response format conversions seamlessly.\n\n### ⚡ Live Config\n- Automatically writes configurations directly to Claude Code when switching Providers.\n- Completely eliminates the need to manually edit config files.\n\n---\n\n## 🏗 Architecture\n\nCC Switch UI is a pure Web architecture variant, separating the React frontend and Rust backend:\n\n```mermaid\ngraph TD\n    %% Define Styles\n    classDef frontend fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#f8fafc\n    classDef backend fill:#1e1e1e,stroke:#f97316,stroke-width:2px,color:#f8fafc\n    classDef library fill:#27272a,stroke:#10b981,stroke-width:2px,color:#f8fafc\n    classDef ext fill:#172554,stroke:#6366f1,stroke-width:1px,color:#cbd5e1\n\n    %% Nodes\n    UI[\"💻 Browser (React UI)\u003cbr/\u003ehttp://localhost:5007/ui\"]:::frontend\n    \n    subgraph CC_Switch_Web [\"cc-switch-server (Rust + Axum)\"]\n        API[\"🔌 REST API\u003cbr/\u003e/api/*\"]:::backend\n        OAuth[\"🔐 OAuth Handler\u003cbr/\u003ecodex / copilot\"]:::backend\n        Proxy[\"🌐 Local Proxy\u003cbr/\u003e:15721\"]:::backend\n    end\n    \n    subgraph CC_Switch_Lib [\"cc-switch-lib (Rust Core)\"]\n        DB[(\"🗄️ SQLite DB\u003cbr/\u003erusqlite\")]:::library\n        LiveConfig[\"⚡ Live Config\u003cbr/\u003eFile Watcher\"]:::library\n        OAuthCore[\"🔑 OAuth Core\u003cbr/\u003eToken Mgt\"]:::library\n    end\n    \n    ClaudeCode[\"🤖 Claude Code\u003cbr/\u003eCLI Tool\"]:::ext\n    ProviderAPI[\"☁️ Provider API\u003cbr/\u003eAnthropic/OpenAI/etc.\"]:::ext\n\n    %% Connections\n    UI -- \"HTTP /api/*\" --\u003e API\n    UI -- \"OAuth Redirects\" --\u003e OAuth\n    \n    API -.-\u003e DB\n    API -.-\u003e LiveConfig\n    OAuth -.-\u003e OAuthCore\n    Proxy -.-\u003e OAuthCore\n    \n    LiveConfig -- \"Writes config.json\" --\u003e ClaudeCode\n    ClaudeCode -- \"Sends Prompts\" --\u003e Proxy\n    Proxy -- \"Forwards Requests\" --\u003e ProviderAPI\n```\n\n---\n\n## ⚙️ Configuration\n\n| Environment Variable | Default Value | Description |\n|----------------------|---------------|-------------|\n| `CC_SWITCH_ADMIN_TOKEN` | *Auto-generated* | Admin password for Web UI |\n| `CC_SWITCH_PROXY_PORT` | `15721` | Port for the local proxy server |\n| `CC_SWITCH_TEST_HOME` | `-` | Home directory for testing purposes |\n\n---\n\n## 🛠 Development\n\n### Frontend (React + TypeScript + Vite)\n\n```bash\ncd cc-switch-ui\npnpm install\npnpm dev        # Start dev server on http://localhost:5173\npnpm build      # Production build\npnpm lint       # Run ESLint checks\n```\n\n### Backend (Rust + Axum)\n\n```bash\ncargo run -p cc-switch-server     # Run backend server directly\ncargo fmt \u0026\u0026 cargo clippy      # Formatting and linting\ncargo test                     # Run tests\n```\n\n### Project Structure\n\n```text\ncc-switch-ui/          # React frontend workspace\ncc-switch-server/         # Axum HTTP server (Rust)\ncc-switch-lib/         # Shared core library (Rust)\n  └── src/\n      ├── database/    # SQLite persistence via rusqlite\n      ├── oauth/       # OAuth handling (Codex + Copilot)\n      ├── config.rs    # Configuration management\n      └── live.rs      # Live Config synchronization\n```\n\n---\n\n## 🔄 Differences from the Original cc-switch\n\nThis project is a fork of the excellent [cc-switch](https://github.com/farion1231/cc-switch). Here are the main differences:\n\n| Feature | cc-switch (Original) | CC Switch UI (This Project) |\n|---------|----------------------|------------------------------|\n| **Deployment** | Tauri Desktop App | Pure Web Service |\n| **System Tray** | Supported | Not Supported |\n| **MCP Management**| Supported | *Planned* |\n| **Cloud Sync** | Supported | Not Supported |\n| **Core Focus** | Full feature set | Focused on Provider Management |\n\n---\n\n## 🙏 Acknowledgements\n\nBuilt upon the excellent open-source project [cc-switch](https://github.com/farion1231/cc-switch).\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangbogeng%2Fcc-switch-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuangbogeng%2Fcc-switch-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangbogeng%2Fcc-switch-ui/lists"}