# Repository Briefing: SaladDay/cc-switch-cli
> Source: https://repoforai.com/repo/SaladDay/cc-switch-cli (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/SaladDay/cc-switch-cli
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Rust
- **License**: MIT
- **Engineering Health**: A+ (94/100 · Maintenance 35/35 · Adoption 19/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v5.11.4 (2026-11-17) — https://github.com/SaladDay/cc-switch-cli/releases
- **Review Snapshot**: 2026-11-29
- **Deployment / Stack Signals**: CLI
- **Momentum**: 5,664 ★ total (+4 24h / +68 7d) · 535 forks
- **When to Use**: Best for: Terminal-first developers who use multiple coding assistants or providers and need scriptable configuration, MCP sync, or separate provider choices across terminals. Skip if: Native settings already cover a single-assistant workflow, or you need a self-contained offline inference runtime or daemon-managed proxy routes on Windows.

## Overview
```text
### Architecture & Core Mechanics
CC Switch CLI is a Rust fork of the CC Switch desktop application. It reuses the desktop service layer behind a full-screen TUI and a scriptable `cc-switch` entry point. It manages external coding assistants rather than performing inference. SQLite holds providers, MCP definitions, prompts, and app state in `~/.cc-switch/cc-switch.db`; skill source files live under `skills/`, and legacy `config.json` remains for import and migration.

Managed state is distinct from the files each assistant consumes. For example, Claude uses `~/.claude/settings.json` for provider settings and `~/.claude.json` for MCP, while Codex uses `config.toml` and `auth.json` in its resolved configuration directory. By default, live sync skips uninitialized apps. The service layer uses scoped `RwLock` guards and writes a temporary file before renaming it into place. An optional relay uses a Unix-domain-socket supervisor with a separate worker for each active supported app route.

### Key Capabilities & Differentiators
The CLI manages providers for Claude Code, Codex, Gemini CLI, OpenCode, Hermes, OpenClaw, and Pi. `--app` selects the target, while `provider switch` and `use` change its global provider. `start claude` and `start codex` instead select a provider for the launched process only. The tool also syncs MCP definitions, imports token and cost data from local sessions, and exposes a 30-day app and model breakdown in the TUI. Shared Codex launches on macOS and Linux can reuse session files, archives, and the SQLite history index across providers.

Proxy routing is narrower than provider management: it serves Claude Code, Codex, and Gemini. Routes have independent ports and can be enabled or disabled separately. The supervisor starts on the first active route and exits after the last route is disabled; foreground mode can be used for debugging when daemon-managed routes are inactive. The relay adapts OpenAI Responses and Chat Completions providers and lets Codex use Anthropic Messages-compatible endpoints. Examples of supported upstreams include DeepSeek, Kimi, Qwen, and OpenRouter, subject to the route and protocol.

### Trade-offs & Limitations
For one assistant and one provider, native configuration has fewer moving parts: it avoids a separate database and another tool writing client files. The CLI earns its place when switching providers, synchronizing MCP definitions, or collecting usage data is a recurring task. Compared with upstream CC Switch Desktop, it favors shell automation and terminal interaction while retaining WebDAV interoperability. Global switches and per-launch overrides are not interchangeable, and cross-platform installation does not imply that the Unix-socket proxy supervisor is available on Windows.

Codex shared history is not a guarantee that any provider can resume any session. Launch directories under `.cc-switch-launches/` must remain in place because Codex records session paths through them. Per-thread writer locks are shared, and overrides such as `--config`, `--profile`, and `--oss` are unavailable in shared mode. A new upstream must also accept the previous conversation content, including encrypted reasoning. The MIT license covers the tool, not upstream service access or terms; evaluate credential handling and data destinations separately when using WebDAV or third-party relays.

### Hardware & Deployment Guide
Install a prebuilt binary for macOS, Linux, or Windows, or use `brew install cc-switch-cli` and continue to upgrade through Homebrew. The macOS release offers a universal binary; Linux provides x64 and ARM64 musl builds, and installer auto mode does not fall back to glibc. Source builds require Rust 1.85+ and run `cargo build --release` from `src-tauri/`. The CLI itself does not run models: local overhead comes from configuration and history storage and any enabled proxy workers. Requests still go to the selected upstream endpoints.

Start with `cc-switch config path` and `cc-switch config validate` to check the active configuration. Setting `CC_SWITCH_CONFIG_DIR` selects a new root without migrating existing data. Local backup rotation keeps 10 copies. Before upgrading across desktop and CLI versions, back up configuration and check schema compatibility: v5.11.3 restored startup and WebDAV compatibility for schemas 21 and 22; v5.11.4 restored compatibility with desktop v4.0.33 schema 26 and added managed ChatGPT account selection for Codex.
```

## Key Capabilities
```text
- State management: `cc-switch.db` stores managed configuration, while skill source files live under `skills/` and legacy JSON serves import and migration paths.
- Live configuration: Atomic file replacement and default skipping of uninitialized apps reduce the risk of partial writes and unexpected config directories.
- Provider scope: `provider switch` and `use` change the global provider; `start claude` and `start codex` scope the selection to a single launch.
- Codex history: `--shared-sessions` shares session files and the SQLite index while retaining per-provider launch directories and shared writer locks.
- Model relay: A Unix-socket supervisor starts one worker per active Claude, Codex, or Gemini route, with configurable ports and token accounting.
- Interoperability: WebDAV sync works with upstream CC Switch; v5.11.4 restores desktop v4.0.33 schema 26 compatibility.
```

## Quick Start / Clone
```bash
curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
```
