# cc-switch-cli **Repository Path**: graviton/cc-switch-cli ## Basic Information - **Project Name**: cc-switch-cli - **Description**: No description available - **Primary Language**: Rust - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-16 - **Last Updated**: 2026-11-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![CC-Switch CLI — one switchboard for every AI CLI](assets/screenshots/hero.png)
## CC-Switch CLI **Manage Claude Code, Codex, Gemini, OpenCode, Hermes, OpenClaw, and Pi from one interactive TUI or scriptable CLI.** [![Version](https://img.shields.io/badge/version-5.11.3-blue.svg)](https://github.com/saladday/cc-switch-cli/releases) [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/saladday/cc-switch-cli/releases) [![Built with Rust](https://img.shields.io/badge/built%20with-Rust-orange.svg)](https://www.rust-lang.org/) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) SaladDay%2Fcc-switch-cli | Trendshift English | [中文](README_ZH.md) | [日本語](README_JA.md)
--- ## 📖 About This project is a **CLI fork** of [CC-Switch](https://github.com/farion1231/cc-switch). 🔄 The WebDAV sync feature is fully compatible with the upstream project. **Changelog:** [CHANGELOG.md](CHANGELOG.md) --- ## ❤️ Sponsor
88API Thanks to 88API Token Aggregation Platform for sponsoring this project! 88API is a one-stop multi-model API platform operated by a Hong Kong company, built mainly for developers, creators and AI application users. A unified interface gives access to text, image, speech and video models, covering common workflows such as AI coding, smart translation, content creation, voice-over, image generation and video generation. You can add it as a provider and switch to it right inside CC-Switch CLI. 88API supports major international payment methods, can issue invoices, and provides enterprise-grade stable service. Register via this link to receive exclusive bonus credits!
APIMart Thanks to APIMart for sponsoring this project! APIMart is a low-cost API platform for AI image & video generation — GPT-Image-2 from $0.006/image, 160+ images per dollar. One async API covers both image and video: submit a task, get an ID, fetch results via polling or callback. Batch tens of thousands of images without timeouts, switch models without changing code. Pay-as-you-go with no monthly fee — sign up here to get started.
Cubence Thanks to Cubence for sponsoring this project! Cubence is an API relay service provider dedicated to offering stable and efficient services to its customers. Operating since September 2025, it has provided support for various models such as Claude code, Codex, and Gemini. Register via this link and use the CCSCLI discount code when topping up to enjoy a 10% discount.
OpenModel One API, every top model! OpenModel is a production-grade, high-availability AI API gateway that makes your applications truly fast and stable: automatic failover, smart routing to the best-performing channel, and a production-grade SLA. An SLA that far surpasses any single provider — making stability your core competitive advantage. Works directly with Claude Code, Codex, and Gemini CLI. Register via this link to get started.
PackyCode 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 via this link and use promo code cc-switch-cli when recharging to get 10% off.
IPWO Thanks to IPWO for sponsoring this project! IPWO offers a free trial and access to over 90 million active residential IPs across 195+ countries and regions. It supports rotating, static, and unlimited-bandwidth residential proxies, with HTTP(S) and SOCKS5 compatibility.
From AI tool development and cross-region network access to API debugging and data collection, IPWO gives developers flexible residential proxy options for applications in different regions.
Visit IPWO and use promo code 0200 for 10% off.
DDS Thanks to DDS for sponsoring this project! DDS Hub is a reliable and high-performance Claude API proxy service. DDS Hub provides cost-effective domestic Claude direct acceleration services for both individual and enterprise users. We offer stable and low-latency Claude Max number pools, with full support for Claude Haiku, Opus, Sonnet and other flagship models. Invoices are available for recharges of 1000 RMB or more. Enterprise customers can also enjoy customized grouping and dedicated technical support services.
Exclusive benefit for CC-Switch CLI users: register via this link and enjoy an extra 10% credit on your first recharge (please contact the group admin to claim after recharging)!
--- ## 📸 Screenshots

Home

Home

Switch Settings
Switch Settings
## 🚀 Quick Start **TUI Mode (Recommended)** ```bash cc-switch ``` Use the full-screen interface to switch providers, manage accounts, review sessions, and inspect proxy status. **Command-Line Mode** ```bash cc-switch provider list # List providers cc-switch provider switch # Switch provider cc-switch use # Switch provider (shortcut) cc-switch provider export # Export a Claude provider to a standalone settings file cc-switch provider stream-check # Check provider stream health cc-switch start claude # Launch Claude with this provider without switching globally cc-switch start codex # Launch Codex with this provider without switching globally cc-switch start codex --shared-sessions # Share persistent Codex history across providers cc-switch start claude --dry-run # Preview the launch without starting Claude cc-switch auth list # List managed ChatGPT/Codex OAuth accounts cc-switch sessions list --all # Review saved assistant sessions cc-switch sessions sync-usage --all # Import local session token/cost usage cc-switch config webdav show # Inspect WebDAV sync settings cc-switch env tools # Check local CLI tools cc-switch mcp sync # Sync MCP servers cc-switch proxy show # Inspect proxy routes and status # Use the global `--app` flag to target specific applications: cc-switch --app claude provider list # Manage Claude providers cc-switch --app codex mcp sync # Sync Codex MCP servers cc-switch --app gemini prompts list # List Gemini prompts cc-switch --app hermes provider list # Manage Hermes providers cc-switch --app openclaw provider list # Manage OpenClaw providers cc-switch --app pi provider list # Manage Pi providers # Supported apps: `claude` (default), `codex`, `gemini`, `opencode`, `hermes`, `openclaw`, `pi` ``` Use `cc-switch start` when you want different providers in multiple terminals. It only affects the Claude or Codex session launched by that command; `provider switch` and `use` still change the global provider. In the TUI, select a provider on the Providers page and press `o` for the same behavior. On macOS/Linux, add `--shared-sessions` to `start codex` to share the configured Codex home's sessions, archived sessions, and SQLite history index. Each provider uses a persistent, private directory under that home's `.cc-switch-launches/`; these directories must remain in place because Codex records session paths through them. Different providers can run concurrently; a second shared launch of the same provider is rejected while the first is running. Codex's per-thread writer locks are shared too, so close an active session before resuming it from another provider. Login changes are saved back to that provider, while launch-specific configuration is kept out of the saved provider settings. Native `--model`, `resume`, and `fork` arguments are supported; `--config`, `--profile`, and `--oss` overrides are not supported in shared mode. Shared launches use the existing unified `custom` provider identifier without changing the global history setting. To include older official sessions, use the existing **Unified Codex session history** setting and its optional migration. Cross-provider continuation still depends on the upstream accepting the old conversation's content, including encrypted reasoning. The default temporary launch and the TUI `o` shortcut remain unchanged. See the "Features" section for full command list. --- ## 📥 Installation ### Method 1: Quick Install (macOS / Linux) > Windows users: see Manual Installation below. ```bash curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash ``` This installs `cc-switch` to `~/.local/bin`. Set `CC_SWITCH_INSTALL_DIR` to change the target directory. - If the target already exists, the installer prompts in TTY and refuses to overwrite in non-interactive shells unless `CC_SWITCH_FORCE=1` is set. - On Linux, auto mode uses the static musl build and never falls back to glibc. Set `CC_SWITCH_LINUX_LIBC=glibc` only when you explicitly need a compatible glibc build.
Manual Installation #### macOS ```bash # Download Universal Binary (recommended, supports Apple Silicon + Intel) curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-darwin-universal.tar.gz # Extract tar -xzf cc-switch-cli-darwin-universal.tar.gz # Add execute permission chmod +x cc-switch # Move to PATH sudo mv cc-switch /usr/local/bin/ # If you encounter "cannot be verified" warning xattr -cr /usr/local/bin/cc-switch ``` #### Linux (x64) ```bash # Download curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-linux-x64-musl.tar.gz # Extract tar -xzf cc-switch-cli-linux-x64-musl.tar.gz # Add execute permission chmod +x cc-switch # Move to PATH sudo mv cc-switch /usr/local/bin/ ``` #### Linux (ARM64) ```bash # For Raspberry Pi or ARM servers curl -LO https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-linux-arm64-musl.tar.gz tar -xzf cc-switch-cli-linux-arm64-musl.tar.gz chmod +x cc-switch sudo mv cc-switch /usr/local/bin/ ``` #### Windows ```powershell # Download the zip file # https://github.com/saladday/cc-switch-cli/releases/latest/download/cc-switch-cli-windows-x64.zip # After extracting, move cc-switch.exe to a PATH directory, e.g.: move cc-switch.exe C:\Windows\System32\ # Or run directly .\cc-switch.exe ```
### Method 2: Install via Homebrew If you are using Homebrew on your machine, you can use Homebrew to install cc-switch. ``` brew install cc-switch-cli ``` Update: ``` brew upgrade cc-switch-cli ``` If you installed cc-switch via Homebrew, please use Homebrew to upgrade cc-switch, instead of the built-in update feature, as this breaks Homebrew formulae’s own upgrade functionality. ### Method 3: Build from Source **Prerequisites:** - Rust 1.85+ ([install via rustup](https://rustup.rs/)) **Build:** ```bash git clone https://github.com/saladday/cc-switch-cli.git cd cc-switch-cli/src-tauri cargo build --release # Binary location: ./target/release/cc-switch ``` **Install to System:** ```bash # macOS/Linux sudo cp target/release/cc-switch /usr/local/bin/ # Windows copy target\release\cc-switch.exe C:\Windows\System32\ ``` --- ## ✨ Features ### 🔌 Provider Management Manage API configurations for **Claude Code**, **Codex**, **Gemini**, **OpenCode**, **Hermes**, **OpenClaw**, and **Pi**. Pi provider management follows Pi's native additive model: membership comes from `models.json.providers`. CC-Switch does not modify Pi login credentials or its global default provider/model. The Pi TUI keeps the same table/form/shortcut conventions as the other apps and exposes Presets, System Prompts, and Prompt Templates as separate pages. **Features:** One-click switching, standalone Claude settings export, multi-endpoint support, API key management, remote model discovery, and per-app diagnostics such as speed testing or stream health checks where supported. ```bash cc-switch provider list # List all providers cc-switch provider current # Show current provider cc-switch provider switch # Switch provider cc-switch use # Switch provider (shortcut) cc-switch provider add # Add new provider cc-switch provider edit # Edit existing provider cc-switch provider duplicate # Duplicate a provider cc-switch provider delete # Delete provider cc-switch provider export # Export to ./.claude/settings.local.json for Claude auto-load cc-switch provider speedtest # Test API latency cc-switch provider stream-check # Run stream health check cc-switch provider fetch-models # Fetch remote model list cc-switch provider export --output ~/.claude/settings-demo.json # Custom settings file path ``` ### 🔐 Managed Accounts Manage ChatGPT/Codex OAuth accounts locally and reuse them across provider profiles, including using a Codex OAuth account as a Claude Code provider through the local proxy. **Features:** device-flow login, account listing, default account selection, account removal, and provider binding without copying long-lived tokens into each provider. ```bash cc-switch auth status # Show managed account status cc-switch auth login # Sign in with ChatGPT/Codex OAuth cc-switch auth login --account-id # Reauthenticate an existing account, preserving bindings cc-switch auth list # List signed-in accounts cc-switch auth default # Set the default account cc-switch auth remove # Remove an account ``` Members of the same ChatGPT workspace have separate local account IDs. Managed accounts saved by older versions require reauthentication: find the ID with `cc-switch auth list`, then run `cc-switch auth login --account-id `, or choose **Reauthenticate** in the TUI account menu. Sign in as the original user in the same workspace to preserve provider bindings. ### 🛠️ MCP Server Management Manage Model Context Protocol servers across Claude, Codex, Gemini, OpenCode, and Hermes. **Features:** Unified management, multi-app support, stdio/http/sse transports, authenticated remote-server headers, automatic sync, and TOML/JSON live-config adapters. ```bash cc-switch mcp list # List all MCP servers cc-switch mcp add # Add new MCP server (interactive) cc-switch mcp edit # Edit MCP server cc-switch mcp delete # Delete MCP server cc-switch mcp enable --app claude # Enable for specific app cc-switch mcp disable --app claude # Disable for specific app cc-switch mcp validate # Validate command in PATH cc-switch mcp sync # Sync to live files cc-switch mcp import --app claude # Import from live config ``` ### 💬 Prompts Management Manage system prompt presets for AI coding assistants. **Cross-app support:** Claude (`CLAUDE.md`), Codex (`AGENTS.md`), Gemini (`GEMINI.md`), OpenCode (`AGENTS.md`), Hermes (`AGENTS.md`), OpenClaw (`AGENTS.md`), Pi (`AGENTS.md`, native system prompts, and prompt templates). ```bash cc-switch prompts list # List prompt presets cc-switch prompts current # Show current active prompt cc-switch prompts activate # Activate prompt cc-switch prompts deactivate # Deactivate current active prompt cc-switch prompts create [name] # Create a prompt preset, optionally naming it up front cc-switch prompts rename [name] # Rename prompt preset, interactive if name is omitted cc-switch prompts edit # Edit prompt preset cc-switch prompts show # Display full content cc-switch prompts delete # Delete prompt cc-switch --app pi prompts system edit append # Edit APPEND_SYSTEM.md cc-switch --app pi prompts templates list # List Pi prompt templates ``` ### 🎯 Skills Management Manage and extend Claude Code/Codex/Gemini/OpenCode/Hermes/Pi capabilities with community skills. **Features:** SSOT-based skills store, multi-app enable/disable, sync to app directories, manual update checks/updates, unmanaged scan/import, repo discovery, skills.sh marketplace search. ```bash cc-switch skills list # List installed skills cc-switch skills discover # Discover available skills (alias: search) cc-switch skills market # Search skills.sh marketplace cc-switch skills install # Install a skill cc-switch skills check-updates # Manually check for updates cc-switch skills update # Update one repository-backed skill cc-switch skills update --all # Update all detected updates cc-switch skills uninstall # Uninstall a skill cc-switch skills enable # Enable for current app (--app) cc-switch skills disable # Disable for current app (--app) cc-switch skills info # Show skill information cc-switch skills sync # Sync enabled skills to app dirs cc-switch skills sync-method [m] # Show/set sync method (auto|symlink|copy) cc-switch skills scan-unmanaged # Scan unmanaged skills in app dirs cc-switch skills import-from-apps # Import unmanaged skills into SSOT cc-switch skills repos list # List skill repositories cc-switch skills repos add # Add repo (owner/name[@branch] or GitHub URL) cc-switch skills repos remove # Remove repo (owner/name or GitHub URL) cc-switch skills repos enable # Enable repo without changing branch cc-switch skills repos disable # Disable repo without changing branch ``` ### 📊 Usage Overview The TUI home page shows a responsive 30-day view by app and model, including token/cost breakdowns, proxy state, and background refresh. ### 🕘 Session History & Usage Statistics Review saved assistant sessions, resume a session with one command, delete old records, and import local session logs into token/cost statistics. **Features:** complete paged history, cross-app scanning, message preview, copyable resume commands, safe deletion, JSON output, visible-page token/cost details, and usage sync for Claude, Codex, Gemini, OpenCode, and Pi. Hermes cost is shown when available. ```bash cc-switch sessions list --all # List saved sessions across supported apps cc-switch sessions show # Show session metadata and messages cc-switch sessions resume # Resume a saved session cc-switch sessions delete # Delete a saved session cc-switch sessions sync-usage --all # Sync local logs into usage statistics ``` ### ⚙️ Configuration Management Manage configuration backups, imports, and exports. **Features:** Custom backup naming, interactive backup selection, automatic rotation (keep 10), import/export, common snippets, WebDAV sync. ```bash cc-switch config show # Display configuration cc-switch config path # Show config file paths cc-switch config validate # Validate config file # Claude: open the TUI, edit a provider, then open its JSON editor cc-switch --app claude # Read a legacy common snippet to copy into the configuration editor if needed cc-switch --app claude config common show # Codex / Gemini still support common snippets cc-switch --app codex config common set --snippet 'model_reasoning_effort = "high"' cc-switch --app codex config common clear # Backup cc-switch config backup # Create backup (auto-named) cc-switch config backup --name my-backup # Create backup with custom name # Restore cc-switch config restore # Interactive: select from backup list cc-switch config restore --backup # Restore specific backup by ID cc-switch config restore --file # Restore from external file # Import/Export cc-switch config export # Export to external file cc-switch config import # Import from external file # WebDAV sync cc-switch config webdav show cc-switch config webdav set --base-url --username --password --enable cc-switch config webdav jianguoyun --username --password cc-switch config webdav check-connection cc-switch config webdav upload cc-switch config webdav download cc-switch config webdav migrate-v1-to-v2 cc-switch config reset # Reset to default configuration ``` ### 🌉 Proxy Management & Model Relay Inspect and control daemon-managed per-app proxy routes for supported apps. **Features:** independent enable/disable per app, per-app listen ports, daemon-managed workers, current route inspection, dashboard telemetry, token accounting, and foreground serve mode for debugging. The local proxy can route Claude Code, Codex, and Gemini through CC-Switch, adapt OpenAI Responses API and Chat Completions providers, let Codex use Anthropic Messages-compatible providers, and connect mainstream OpenAI-compatible models such as DeepSeek, Kimi, Qwen, OpenRouter, xAI, Groq, and Mistral where supported. ```bash cc-switch proxy show # Show proxy configuration, routes, and daemon worker status cc-switch proxy enable # Enable the Claude proxy route (default app) cc-switch --app codex proxy enable # Enable the Codex proxy route cc-switch --app gemini proxy disable # Disable the Gemini proxy route cc-switch --app claude proxy config --listen-port 15721 cc-switch --app codex proxy config --listen-port 15722 cc-switch proxy serve --takeover claude # Foreground debug mode; refused while daemon-managed routes are active ``` Normal CLI/TUI proxy enable/disable actions are routed through the daemon. The daemon auto-starts when the first app proxy route is activated, runs one worker per active supported app (Claude, Codex, Gemini), and exits automatically when no proxy routes remain active. > **Platform support:** The daemon-managed proxy relies on a Unix-domain-socket supervisor and is available **only on macOS and Linux**. On Windows, `proxy enable` / `proxy disable` and the `daemon` subcommand are unavailable and fail with `managed sessions are only supported on unix`. To run the local proxy on Windows, use the foreground mode instead, which starts the relay without the supervisor: > > ```bash > cc-switch proxy serve --takeover claude > ``` > > `proxy show` and `proxy config` work on all platforms. See [#294](https://github.com/SaladDay/cc-switch-cli/issues/294). ### 🧪 Environment & Local Tools Inspect environment conflicts and whether required local CLIs are installed. ```bash cc-switch env check # Check environment conflicts cc-switch env list # List relevant environment variables cc-switch env tools # Check Claude/Codex/Gemini/OpenCode/Hermes/OpenClaw/Pi CLIs ``` ### 🌐 Multi-language Support Interactive mode supports English and Chinese, language settings are automatically saved. - Default language: English - Go to `⚙️ Settings` menu to switch language ### 🔧 Utilities Shell completions, environment management, and other utilities. ```bash # Shell completions cc-switch completions install --activate # Recommended: install + activate for bash/zsh cc-switch completions install # Conservative: install only, no rc edits cc-switch completions status # Inspect managed completion status cc-switch completions uninstall # Remove managed completion assets cc-switch completions bash # Compatibility raw generator path cc-switch completions fish # Raw generation still works for non-managed shells # Environment management cc-switch env check # Check for environment conflicts cc-switch env list # List environment variables # Self-update cc-switch update # Update to latest release cc-switch update --version vX.Y.Z # Update to a specific version ``` Automated install/activation currently targets `bash` and `zsh` only. Other shells remain available through the raw generator path, for example `cc-switch completions fish`. --- ## 🏗️ Architecture ### Core Design - **SQLite-backed state**: Core data lives in `~/.cc-switch/cc-switch.db` by default (or under `$CC_SWITCH_CONFIG_DIR/` when set); legacy `config.json` is kept only for older import and migration paths - **Skills SSOT**: Skill source files live in `~/.cc-switch/skills/` by default (or under `$CC_SWITCH_CONFIG_DIR/skills/` when set), while install state and app enablement stay in the database - **Safe Live Sync (Default)**: Skip writing live files for apps that haven't been initialized yet (prevents creating `~/.claude`, `~/.codex`, `~/.gemini`, `~/.config/opencode`, `~/.hermes`, or `~/.openclaw` unexpectedly) - **Atomic Writes**: Temp file + rename pattern prevents corruption - **Service Layer Reuse**: 100% reused from original GUI version - **Concurrency Safe**: RwLock with scoped guards ### Configuration Files **CC-Switch Storage** (default: `~/.cc-switch`, override: `CC_SWITCH_CONFIG_DIR`): - `~/.cc-switch/cc-switch.db` - Main database for providers, MCP, prompts, and app state - `~/.cc-switch/settings.json` - Settings - `~/.cc-switch/skills/` - Installed skill sources (SSOT) - `~/.cc-switch/backups/` - Auto-rotation (keep 10) - `~/.cc-switch/config.json` - Legacy JSON kept for compatibility and import flows When `CC_SWITCH_CONFIG_DIR` is set, CC-Switch uses that directory as its config root; existing data under `~/.cc-switch` is not migrated automatically. **Live Configs:** - Claude: `~/.claude/settings.json` (provider/common config), `~/.claude.json` (MCP), `~/.claude/CLAUDE.md` (prompts) - Codex: `~/.codex/auth.json` (auth state), `~/.codex/config.toml` (provider/common config + MCP), `~/.codex/AGENTS.md` (prompts) - Codex config directory uses CC-Switch's manual override first. If no override is configured, CC-Switch follows Codex's `$CODEX_HOME` when it points to an existing directory, otherwise it uses `$HOME/.codex`. - Gemini: `~/.gemini/.env` (provider env), `~/.gemini/settings.json` (settings + MCP), `~/.gemini/GEMINI.md` (prompts) - OpenCode: `~/.config/opencode/opencode.json` (providers + MCP + runtime config), `~/.config/opencode/AGENTS.md` (prompts) - Hermes: `/config.yaml` (providers + MCP + memory settings), `AGENTS.md` (prompts), `skills/`, and `memories/`. Directory priority: `hermesConfigDir` in CC-Switch settings, then nonblank `HERMES_HOME`, then the platform default (`~/.hermes` on macOS/Linux; `%LOCALAPPDATA%\hermes` on Windows). Launch CC-Switch from an environment that exports the same `HERMES_HOME` as Hermes. - OpenClaw: `~/.openclaw/openclaw.json` (providers + env/tools/agents defaults), `~/.openclaw/AGENTS.md` (prompts) - Pi: `~/.pi/agent/models.json` (additive providers), `~/.pi/agent/settings.json` (read-only defaults/session location), `~/.pi/agent/AGENTS.md`, `SYSTEM.md`, `APPEND_SYSTEM.md`, `prompts/`, `skills/`, and `sessions/` --- ## ❓ FAQ (Frequently Asked Questions)
Why doesn't my configuration take effect after switching providers?
First, make sure the target CLI has been initialized at least once (i.e. its config directory exists). CC-Switch may skip live sync for uninitialized apps; you will see a warning. Run the target CLI once (e.g. `claude --help`, `codex --help`, `gemini --help`, `opencode --help`, `openclaw --help`) or create `~/.hermes` for Hermes, then switch again. This is usually caused by **environment variable conflicts**. If you have API keys set in system environment variables (like `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`), they will override CC-Switch's configuration. **Solution:** 1. Check for conflicts: ```bash cc-switch env check --app claude ``` 2. List all related environment variables: ```bash cc-switch env list --app claude ``` 3. If conflicts are found, manually remove them: - **macOS/Linux**: Edit your shell config file (`~/.bashrc`, `~/.zshrc`, etc.) ```bash # Find and delete the line with the environment variable nano ~/.zshrc # Or use your preferred text editor: vim, code, etc. ``` - **Windows**: Open System Properties → Environment Variables and delete the conflicting variables 4. Restart your terminal for changes to take effect.
Proxy startup fails with `Address already in use`. What should I do?
This means another process is already listening on the proxy port. A common case after upgrading or debugging is that an old `cc-switch daemon` / `cc-switch proxy serve` process is still running in the background, but the new process did not attach to it. First check the current proxy port with `cc-switch proxy show`, for example `configured 15722`. **macOS / Linux:** ```bash # See which process owns the port. Replace 15722 with your proxy port. lsof -nP -iTCP:15722 -sTCP:LISTEN # List cc-switch processes and identify the daemon / proxy worker. ps -axo pid,ppid,stat,command | grep '[c]c-switch' # If the daemon is reachable, stop it cleanly first. cc-switch daemon stop # If the daemon is not reachable but the port is still occupied, terminate the matching PIDs. kill # If they still do not exit, force terminate them. kill -9 ``` Only terminate processes that are clearly shown as `cc-switch daemon start` or `cc-switch proxy serve`. Do not kill unrelated apps just because they use a nearby port. **Windows:** ```powershell netstat -ano | findstr :15722 taskkill /PID /F ``` Then restart: ```bash cc-switch proxy show cc-switch ```
Which apps are supported?
CC-Switch currently supports seven AI coding assistants: - **Claude Code** (`--app claude`, default) - **Codex** (`--app codex`) - **Gemini** (`--app gemini`) - **OpenCode** (`--app opencode`) - **Hermes** (`--app hermes`) - **OpenClaw** (`--app openclaw`) - **Pi** (`--app pi`) Use the global `--app` flag to specify which app to manage: ```bash cc-switch --app codex provider list ```
How do I report bugs or request features?
Please open an issue on our [GitHub Issues](https://github.com/saladday/cc-switch-cli/issues) page with: - Detailed description of the problem or feature request - Steps to reproduce (for bugs) - Your system information (OS, version) - Relevant logs or error messages
--- ## 🛠️ Development ### Requirements - **Rust**: 1.85+ ([rustup](https://rustup.rs/)) - **Cargo**: Bundled with Rust ### Commands ```bash cd src-tauri cargo run # Development mode cargo run -- provider list # Run specific command cargo build --release # Build release cargo fmt # Format code cargo clippy # Lint code cargo test # Run tests ``` ### Library-only Builds Embedding consumers can omit CLI/TUI dependencies: ```toml cc-switch = { git = "https://github.com/SaladDay/cc-switch-cli.git", default-features = false } ``` The `cli` feature is enabled by default and is required for the `cc-switch` binary. ### Code Structure ``` src-tauri/src/ ├── cli/ │ ├── commands/ # CLI subcommands (provider, mcp, prompts, skills, proxy, env, ...) │ ├── tui/ # Interactive TUI mode (ratatui) │ ├── interactive/ # Interactive entrypoint / TTY gate │ └── ui/ # UI utilities (tables, colors) ├── services/ # Business logic (provider, mcp, prompt, webdav, ...) ├── database/ # SQLite storage, migrations, backup ├── main.rs # CLI entry point └── ... # App-specific configs, proxy, error handling ``` ## 🤝 Contributing Contributions welcome! This fork focuses on CLI functionality. **Before submitting PRs:** - ✅ Pass format check: `cargo fmt --check` - ✅ Pass linter: `cargo clippy` - ✅ Pass tests: `cargo test` - 💡 Open an issue for discussion first --- ## 📜 License - MIT © Original Author: Jason Young - CLI Fork Maintainer: saladday