SaladDay/cc-switch-cli
GitHub Trending ×7dRust CLI and TUI for managing coding assistants, providers, and MCP settings
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
cc-switch.db stores managed configuration, while skill source files live under skills/ and legacy JSON serves import and migration paths.provider switch and use change the global provider; start claude and start codex scope the selection to a single launch.--shared-sessions shares session files and the SQLite index while retaining per-provider launch directories and shared writer locks.Terminal-first developers who use multiple coding assistants or providers and need scriptable configuration, MCP sync, or separate provider choices across terminals.
Native settings already cover a single-assistant workflow, or you need a self-contained offline inference runtime or daemon-managed proxy routes on Windows.
Quick Start & Installation
curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| cc-switch-cli ★ | 5.7k | +68 | Rust | MIT | Rust CLI and TUI for managing coding assistants, providers, and MCP settings |
| impeccable | 121.7k | +3.5k | Rust | Apache-2.0 | Coding-agent design skills with a Rust CLI for repeatable UI checks |
| rtk | 88.7k | +684 | Rust | Apache-2.0 | A local Rust CLI wrapper that trims command output before coding agents read it. |
| ECC | 316.1k | +4.2k | JavaScript | MIT | Plugins and CLI workflows for planning, reviewing, and verifying agent-written c |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/SaladDay/cc-switch-cli.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about cc-switch-cli
How do I run two Codex providers without changing the global configuration?
cc-switch use <id> changes the global provider. cc-switch start codex <id> selects a provider only for the launched process. On macOS and Linux, --shared-sessions lets those launches share the configured Codex home's session files and SQLite history index through persistent per-provider directories. A second shared launch for the same provider is rejected while the first is running.Does the CLI need a GPU, and what should I size for?
Can we deploy it commercially and keep data on infrastructure we control?
When is this preferable to native settings or upstream CC-Switch Desktop?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy