Skip to content
CAI
Software that uses CAICheck a score

SaladDay/cc-switch-cli

53.4

Adequate · 13 September 2026

339.3k

lines of production code

Rust

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

cc-switch is a command-line tool and terminal user interface for managing AI coding assistant configurations, proxy routing, and session history. It acts as a unified proxy layer that handles provider switching, automatic failover, cost tracking, and request optimization for tools like Claude, Codex, and Gemini. The system persists settings in a local SQLite database and supports synchronization via WebDAV or S3, while also providing capabilities to import, export, and manage MCP servers, prompts, and skills.

How it got here

2025 — Migration to Tauri and Rust CLI

16 changes.

The project migrated its runtime from an Electron/React desktop application to a Tauri-based architecture with a Rust backend, replacing the GUI with a comprehensive CLI and interactive Ratatui interface. This period involved removing legacy renderer and main process code while implementing new features such as deep-link imports, background proxy daemon management, and per-user installation support.

2026 — TUI overhaul and proxy modernization

29 changes.

This period focused on replacing the legacy CLI with a comprehensive ratatui-based terminal interface and migrating configuration storage from JSON to a robust SQLite database. The proxy layer was significantly restructured to introduce a provider adapter framework, circuit breakers for failover, and detailed usage cost tracking. These changes were supported by extensive integration testing and the addition of deep link import capabilities for seamless configuration management.

Features

Automated latest.json manifest generation for releases

A new Python script, generate\_latest\_json.py, has been added to the scripts directory to automate the creation of the latest.json release manifest. This tool scans a specified release directory for signed asset files (including darwin-universal, darwin-x64, darwin-arm64, linux-x64 with musl/glibc variants, linux-arm64 with musl/glibc variants, and windows-x64) and generates a structured JSON file containing download URLs and cryptographic signatures. This enables users and automated systems to reliably locate and verify the latest available binaries for supported platforms.

scripts · high confidence

The application now supports importing configuration resources through the \ccswitch://v1/import\ protocol. Users can import AI provider settings (including Claude, Codex, Gemini, OpenCode, OpenClaw, and Hermes), MCP server definitions, prompt templates, and skill repositories by following a deep link. The import logic handles URL parsing, Base64 decoding of embedded configurations, and validation of endpoints and homepages. Existing providers are merged (preserving current settings while updating app flags), while new resources are added to the local store.

src-tauri/src/deeplink · high confidence

The application now supports importing providers, MCP servers, prompts, and skills through a custom \ccswitch://\ URL scheme. This is enabled by registering the \ccswitch\ URL type in the macOS \Info.plist\ manifest, allowing external links or commands to trigger in-app import workflows directly.

src-tauri/src · high confidence

Introduce inline configuration editing for providers, MCP servers, prompts, and cloud sync

The TUI now features a unified inline editing interface for configuration forms, replacing previous chip-based or modal layouts with a split-pane view that shows editable fields alongside a live JSON preview. This change adds dedicated form renderers for MCP servers, provider settings (including Claude, Codex, and Gemini configurations), prompt metadata, and S3/WebDAV cloud sync settings, allowing users to modify values directly in a table-like view with immediate visual feedback.

src-tauri/src/cli/tui/ui/forms · high confidence

Introduce ratatui-based interactive TUI

The application now features a new interactive terminal user interface built on the ratatui library, replacing the previous CLI implementation. This TUI provides a full-screen, navigable experience with vim-style keybindings, a centralized keymap registry, and context-sensitive help. It introduces dedicated views for Providers, Sessions, Usage, Pricing, MCP, Prompts, Skills, and Settings, along with support for system clipboard integration, icon mode toggling (emoji/ASCII), and wheel-gesture scrolling.

src-tauri/src/cli/tui · high confidence

Introduces a background daemon for proxy worker management and control

The application now runs a persistent background daemon that supervises the proxy worker process, handling automatic restarts with exponential backoff, maintaining a Unix domain socket for inter-process communication, and managing a pidfile to prevent multiple instances. The foreground TUI/CLI connects to this daemon to control proxy takeovers, check status, and reload global settings, ensuring the worker lifecycle is managed independently of the user interface.

src-tauri/src/services · high confidence

Major TUI UI overhaul with new pages and responsive layouts

The TUI interface has been significantly restructured with the introduction of several new UI modules and a shared page frame. A new header module (chrome.rs) now renders the application title, visible app tabs, and dynamic status badges (provider, proxy, default model) with responsive truncation. A dedicated home page (home\_chart.rs) displays a responsive usage dashboard featuring a stacked bar chart and a model cost list that adapts to terminal width. Configuration is now organized into sections (General, Applications, Integrations, System) with dividers (config.rs). New management pages have been added for MCP servers (mcp.rs), Prompts (prompts.rs), and Provider pricing (pricing.rs), all utilizing a consistent table-based layout with filtering and keymap integration. The providers list (providers.rs) now includes proxy requirement badges and failover queue indicators. These changes collectively modernize the TUI's visual consistency and information density.

src-tauri/src/cli/tui/ui · high confidence

New CLI application with provider, session, and proxy management

The application has migrated from a Tauri GUI to a standalone CLI, introducing a comprehensive command-line interface for managing provider configurations, MCP servers, skills, prompts, and local proxy routes. This change adds new capabilities including temporary launches for Claude Code and Codex (with shared session history support for Codex), automatic failover policies, provider quota and usage queries, and an external editor detection system. The CLI also supports interactive mode, shell completions, deep link imports, and environment checks, replacing the previous desktop-centric interaction model.

src-tauri/src/cli · high confidence

New CLI command structure and capabilities

The application has migrated from a Tauri GUI to a CLI-first architecture, introducing a comprehensive set of new commands in the \src-tauri/src/cli/commands\ directory. Users can now manage application targets (e.g., Claude, Codex, Gemini), handle authentication via Codex OAuth, and configure shell completions for Bash and Zsh. Configuration management is expanded with commands to show, export, import, backup, and restore settings, including specific subcommands for OpenClaw, WebDAV, and S3 sync. Additional capabilities include environment variable conflict checking, daemon process management, and importing providers, MCP servers, prompts, and skills via deeplinks.

src-tauri/src/cli/commands · high confidence

New SQLite database module with migration and backup capabilities

The application now uses a new SQLite-based database module (src-tauri/src/database) to replace the previous JSON-based configuration storage. This change introduces a new schema (version 18) that persists provider configurations, MCP servers, prompts, skills, and proxy settings. It includes a migration path to automatically convert existing JSON configuration data into the new SQLite format, as well as robust backup and restore mechanisms for database integrity. The module also enforces stricter file security on Unix systems by rejecting symlinks and hardlinks for the database file.

src-tauri/src/database · high confidence

New Skills management interface in the TUI

The TUI now includes a dedicated Skills section with four sub-pages: an Installed list showing enabled apps (Claude, Codex, Gemini, OpenCode, Hermes, Pi) and update status, a Discover page for browsing skills from repositories or the skills.sh marketplace with search and install capabilities, a Repos page for managing custom skill repositories, and a Detail view for individual skill configuration. This provides a unified interface for discovering, installing, and managing AI skills directly from the terminal.

src-tauri/src/cli/tui/ui/skills · high confidence

New TUI application state and content management architecture

The TUI application now uses a centralized \app\_state.rs\ to define a comprehensive \Action\ enum, covering session management (deep search, project filtering, resume), skills (install, update, discover, sync), provider configuration (switching, failover, quota, speedtest), usage/pricing dashboards, and managed authentication. This state model is driven by new content modules (\content\_config.rs\, \content\_entities.rs\, \content\_pricing.rs\, \content\_skills.rs\, \content\_usage.rs\) that handle specific keymap intents and UI interactions for their respective sections. Additionally, a new \editor\_state.rs\ and \editor\_handlers.rs\ provide a robust, bounded-line-window text editor for JSON/TOML configuration and prompt editing, supporting features like external editor integration and safe handling of large files.

src-tauri/src/cli/tui/app · high confidence

New TUI forms for providers, MCP servers, prompts, and S3 sync

The TUI now includes dedicated configuration forms for managing provider templates (with built-in and sponsor presets), MCP server connections (supporting stdio, HTTP, and SSE transports with environment/header overrides), prompt editing, and S3-compatible cloud sync (AWS, Minio, Cloudflare R2). These forms handle state tracking, validation, and data population for their respective domains.

src-tauri/src/cli/tui/form · high confidence

New TUI runtime actions module for configuration, providers, and session management

The \src-tauri/src/cli/tui/runtime\_actions\ directory has been introduced to centralize the command handlers for the TUI. This module implements the backend logic for managing provider configurations (including live config imports, switching, and failover queue guards), handling temporary launches for Claude and Codex apps, and managing MCP server toggles and imports. It also adds actions for editing prompts, configuring S3/WebDAV sync, and viewing pricing data, effectively replacing scattered action logic with a unified, testable runtime action context.

_src-tauri/src/cli/tui/runtime\actions · high confidence

New TUI runtime systems for background processing and session cost calculation

The TUI now uses a dedicated runtime system architecture to handle background tasks, improving responsiveness. This includes a new session cost calculation worker that lazily starts to compute pricing for session pages, and a suite of worker threads for managing Codex history migration, proxy settings, quota checks, skills, speed tests, and WebDAV/S3 cloud sync. These systems process messages asynchronously to keep the UI responsive during heavy operations like session scanning and data loading.

_src-tauri/src/cli/tui/runtime\systems · high confidence

New database DAO layer for failover, MCP, pricing, and usage tracking

The application introduces a comprehensive Data Access Object (DAO) layer in \src-tauri/src/database/dao\ to manage new and existing data domains. This includes a failover queue system that allows users to manage provider failover priorities and prevents emptying the queue while auto-failover is active. New MCP (Model Context Protocol) server management enables CRUD operations for servers with per-app enablement flags (Claude, Codex, Gemini, etc.). Model pricing is now persisted with support for input, output, and cache costs, including a mechanism to track and prune deleted pricing entries. Additionally, the DAO adds support for usage rollups (aggregating proxy logs into daily stats), prompt management, skill installation tracking across multiple apps, and proxy configuration storage.

src-tauri/src/database/dao · high confidence

New persistent session scan cache and paged manifest system

The session management layer now uses a persistent SQLite sidecar cache (\session-scan-cache.db\) to store parsed session metadata, allowing the application to skip re-parsing unchanged files on startup and significantly improving scan performance. This cache is backed by a new immutable, page-oriented manifest system that stores scan results as versioned JSON pages, enabling efficient, bounded-memory browsing of large session histories and supporting project-scoped views and full-text search without loading the entire history into memory.

_src-tauri/src/session\manager · high confidence

New provider adapter framework with multi-auth and streaming support

The proxy layer now uses a \ProviderAdapter\ trait to standardize how different AI providers are handled, introducing dedicated adapters for Claude, Codex, Gemini, and GitHub Copilot. This change adds robust authentication management, including OAuth flows for Codex and Copilot, and supports multiple auth strategies (Bearer, Google, Anthropic, etc.) with secure key masking. It also implements complex streaming logic, such as bridging OpenAI Responses to Chat Completions, handling reasoning content extraction, and normalizing model IDs for Copilot, ensuring consistent behavior across diverse upstream APIs.

src-tauri/src/proxy/providers · high confidence

New proxy usage tracking and cost calculation module

Added a new \src-tauri/src/proxy/usage\ module that introduces usage logging and cost calculation capabilities to the proxy. This includes a \calculator\ component that computes request costs using high-precision \Decimal\ arithmetic, handling distinct pricing semantics for different app types (e.g., distinguishing between fresh input tokens for Claude/Anthropic versus total input tokens for Codex/Gemini). The \parser\ component extracts token usage statistics (input, output, cache read/write) from various API response formats (Claude, OpenRouter, Codex, Gemini) for both streaming and buffered responses. The \logger\ component integrates these parsers and calculators to record detailed usage logs, including latency, status codes, and error messages, into the application's database.

src-tauri/src/proxy/usage · high confidence

New session providers for Claude, Gemini, Hermes, OpenClaw, OpenCode, and Pi

The session manager now supports scanning and searching sessions from six additional AI coding tools. This change introduces dedicated provider implementations for Claude, Gemini, Hermes, OpenClaw, OpenCode, and Pi, enabling the application to discover, index, and search session history from these platforms alongside existing integrations.

_src-tauri/src/session\manager/providers · high confidence

New workspace and daily memory file management commands

The application now exposes dedicated commands for managing workspace files and daily memory entries. Users can read, write, and check the existence of specific workspace files (such as AGENTS.md, SOUL.md, etc.) with symlink protection and path validation. Additionally, a new daily memory system allows listing, reading, writing, and searching memory files by date or content, with previews and snippet matching. A command is also provided to open the workspace or memory directory in the system file explorer.

src-tauri/src/commands · high confidence

Removals

Removed Electron main process and IPC layer

The Electron main process entry point (src/main/index.ts), preload script (src/main/preload.ts), and service layer (src/main/services.ts) have been deleted. This removes the native Electron window management, IPC handlers for provider configuration, and the local file-based storage logic that previously managed provider switching and status checks on the backend.

src/main · high confidence

Removed legacy provider management UI components

The custom \AddProviderModal\ and \ProviderList\ components, along with their associated CSS stylesheets, have been removed from the renderer. This eliminates the previous custom-built interface for adding providers via preset buttons and managing provider status/radio selection, indicating a shift away from this specific UI implementation.

src/renderer/components · high confidence

Removed legacy renderer entry points and global styles

Deleted the original renderer shell files (App.tsx, App.css, index.css, index.html, main.tsx) that previously rendered the React application using Electron IPC calls and global CSS resets. This removes the old UI entry point and its associated styling, indicating a shift to a new rendering architecture or component structure in the renderer layer.

src/renderer · high confidence

Behavioural changes

6 commits (0 fixes) modifying src-tauri/icons

A change to existing behaviour in src-tauri/icons — 6 commits, 17 files.

src-tauri/icons · medium confidence · unverified

Added Minisign public key for self-update verification

The application now includes a Minisign public key to verify the signature of self-updates and installer upgrades, ensuring that only authentic and untampered updates are installed.

src-tauri/updater · high confidence

CLI interface now supports per-application theme colors

The CLI user interface has been updated to apply distinct color themes based on the selected AI provider (such as Codex, Claude, Gemini, Hermes, OpenCode, OpenClaw, and Pi). This change introduces a new \colors\ module that configures the \inquire\ library's render settings, ensuring that prompts, selections, and highlights use provider-specific accent colors (e.g., LightGreen for Codex, LightRed for OpenClaw) to improve visual distinction between different app modes.

src-tauri/src/cli/ui · high confidence

Interactive mode now uses the new Ratatui-based UI

The interactive CLI entry point has been updated to exclusively use the new Ratatui-based interface, replacing the legacy TUI. Attempting to force the old interface via the CC\_SWITCH\_LEGACY\_TUI environment variable now results in an error, and the mode requires a TTY to function. This change ensures users interact with the modern, modular UI components rather than the deprecated terminal interface.

src-tauri/src/cli/interactive · high confidence

MSI installer now targets per-user LocalAppData installation

The Windows installer has been switched to a per-user scope, installing application files and registry entries into the user's LocalAppData folder (HKCU) instead of the system-wide Program Files (HKLM). This allows the application to be installed without administrator privileges and ensures that updates and uninstallation are scoped to the individual user account.

src-tauri/wix · high confidence

New TUI overlay key-handling architecture

The TUI now uses a dedicated \overlay\_handlers\ module to manage keyboard input for all overlay interfaces, including confirmation dialogs, MCP key-value editors, various pickers (models, providers, skills, etc.), and help views. This refactoring centralizes overlay logic, enabling features like Codex unified session history confirmation, MCP environment/header editing with validation, and improved navigation in settings and provider forms.

_src-tauri/src/cli/tui/app/overlay\handlers · high confidence

Provider configuration logic is split into dedicated modules

The monolithic provider service has been refactored into distinct modules (claude, codex, gemini, gemini\_auth, live, endpoints, common, common\_config) to improve maintainability. This change introduces specific handling for each provider type: Claude model key normalization, Codex config migration and auth snapshotting, Gemini OAuth vs API-key security flag management, and a new capability to manage custom API endpoints (add, remove, list) for providers.

src-tauri/src/services/provider · high confidence

Proxy engine overhaul with reliability, security, and cost controls

The proxy layer has been significantly expanded and restructured to improve reliability, security, and cost management. A circuit breaker now monitors provider health and automatically fails over when error rates or consecutive failures exceed configured thresholds. Request bodies are now filtered to strip private parameters (keys starting with underscore) while preserving JSON schema definitions, and a new Copilot optimizer classifies requests to mark agent-initiated or compact operations as non-premium, reducing usage costs. Cache injection automatically adds cache control breakpoints to tools, system prompts, and messages to optimize response times. Gemini URL handling has been rewritten to normalize legacy paths into native endpoints, and the proxy now supports multi-app management, failover controls, and global outbound proxy settings.

src-tauri/src/proxy · high confidence

Refactored proxy request building with Codex and Copilot optimizations

The proxy request builder has been rewritten to support new provider integrations and protocol alignments. Key changes include the introduction of a \request\_builder.rs\ module that handles request preparation, including model mapping, header filtering, and body transformation. The code now explicitly supports Codex OAuth account isolation, provider request overrides, and full URL mode for providers. Additionally, Copilot request optimization is enabled, featuring classification of requests (warmup, compact, subagent) and sanitization of orphan tool results. Anthropic tool thinking history is normalized, and Gemini native protocol conversion is aligned. The builder also handles DeepSeek presets and chat bridge base handling for Codex, ensuring responses are correctly bridged to chat providers. TLS trust for native certificate roots is also addressed in the broader proxy context.

src-tauri/src/proxy/forwarder · high confidence

Removal of shared TypeScript type definitions and Electron API interface

The shared type definitions for Provider, ProviderStatus, and AppConfig, along with the global declaration of the electronAPI interface, have been removed from the codebase. This change eliminates the centralized TypeScript contracts and the client-side API surface used to interact with the Electron backend for provider management and status checking, likely as part of a broader refactoring to restructure how these types and communication channels are handled.

src/shared · high confidence

Repository-wide line-ending consistency and developer guidance

The repository now enforces consistent line endings across all source and configuration files (Rust, TOML, JSON, Markdown, YAML, TypeScript, JavaScript, HTML, CSS, and shell scripts) by adding a \.gitattributes\ file that normalizes text files to LF and marks binary assets as such. This change resolves line-ending inconsistencies that can cause spurious diffs and build issues across different operating systems. Additionally, new \AGENTS.md\ and \CLAUDE.md\ files have been added to provide structured guidance for coding agents and developers, detailing project architecture, CLI commands, testing requirements, and state management conventions.

(repo-wide) · high confidence

Unified TUI form handling with vim-style navigation and validation

The TUI now uses a centralized form handler module to manage configuration forms for providers, MCP servers, prompts, and sync settings (S3/WebDAV). This change introduces vim-style navigation (j/k for down/up, h/l for left/right) across all form fields and sub-pages, allowing users to edit configurations more efficiently. It also enforces strict validation on save, preventing the creation of duplicate MCP server IDs, ensuring required fields are filled, and validating specific provider settings (such as Hermes base URLs and Codex model configurations) before committing changes.

_src-tauri/src/cli/tui/app/form\handlers · high confidence

Unified overlay frame and adaptive layout for TUI dialogs

The TUI now uses a shared overlay frame that standardizes the chrome (borders, title, key bar, and padding) across all dialogs, replacing the previous hand-rolled implementations. This change introduces adaptive sizing logic so that message dialogs and pickers automatically resize to fit their content—preventing silent clipping of long text and reducing empty space in compact dialogs—while maintaining consistent visual styling and keyboard navigation across the interface.

src-tauri/src/cli/tui/ui/overlay · high confidence

WebDAV sync upgraded to v2 protocol with skills backup and migration

The WebDAV sync service now uses the v2 protocol, storing data in \{root}/v2/db-v6/{profile}/\ and uploading a \skills.zip\ artifact alongside the database. This change introduces automatic backup and restore capabilities for skills (via \SkillsBackup\) to prevent data loss during sync operations, and adds a \migrate\_v1\_to\_v2\ workflow to handle migration from legacy v1 storage. The sync logic now validates that unified skill storage contains only managed directories before zipping, and ensures remote directories are created before uploading artifacts.

_src-tauri/src/services/webdav\sync · high confidence

Fixes

Improved upstream error handling and response summarization

The proxy now provides better visibility into upstream failures by introducing a new error summarization module that extracts and truncates error messages from JSON responses (checking fields like /error/message, /message, /detail, and /error) for logging. Additionally, the response handling logic has been refined to ensure that non-success responses with parse or transform failures fall back to passing through the raw upstream response, while preserving original proxy errors for non-transform issues. These changes improve debugging and reliability when interacting with upstream chat providers.

src-tauri/src/proxy/response · high confidence

Test coverage

Add CI benchmarking infrastructure for cc-switch CLI and TUI performance; Added comprehensive tests for proxy forwarder error handling, failover, and request building; Added integration tests for Claude OpenAI Chat proxy error handling, logging, and request transformation; Added integration tests for Claude proxy streaming scenarios; Added integration tests for configuration loading, app type parsing, and provider sync.

Dependencies

Migration from Electron to Tauri and Rust CLI

The application has migrated its runtime from an Electron/React-based desktop app to a Tauri-based architecture with a Rust backend and CLI interface. This change removes the previous \package.json\ (and its Electron, React, and Vite dependencies) and introduces a new \src-tauri/Cargo.toml\ and \Cargo.lock\ defining the Rust dependencies (including \clap\, \ratatui\, \reqwest\, and \rusqlite\). For users, this represents a fundamental shift in how the application is built and run, moving away from the Node.js ecosystem to a native Rust implementation.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 53.

Lenses

  • Code Health 80
  • Architecture 97
  • Maturity 65
  • Readiness 41
  • Security 50
  • Domain Modelling 98

Changes since last survey

  • 300 commits — 163 feature/other, 137 fixes

By area

  • src-tauri/src — 254 commits
  • (root) — 22 commits
  • (repo) — 11 commits
  • .github/workflows — 4 commits
  • assets/partners — 2 commits
  • docs/perf-session-usage-scan-plan.md — 2 commits
  • docs/tui-usability-roadmap.md — 2 commits
  • src-tauri/tests — 2 commits
  • scripts/benchmark_cc_switch.py — 1 commit

Notable commits

  • fix: Merge fix for #443: infer OpenCode Zen reasoning settings
  • fix: Merge fix for #447: preserve Codex model mappings
  • fix: Merge fix for #448: normalize empty Chat message content
  • fix: Merge fix for #453: avoid nested executor during SQL import
  • fix: Merge latest main before integrating issue fixes
  • fix: Merge pull request #359 from fjh1997/fix/codex-unified-session-inject-on-live-write
  • fix: fix(android): support Termux directory opener (#370)
  • fix: fix(android): support session usage file locking
  • fix: fix(auth): run Codex login polling sleep in runtime
  • fix: fix(build): guard Unix database validation on Windows
  • fix: fix(ci): remove brittle session picker render test
  • fix: fix(ci): repair migration backup and TUI benchmarks
  • fix: fix(claude): avoid false live conflicts on provider switch (#289)
  • fix: fix(claude): scope switch live merge base (#291)
  • fix: fix(claude,gemini): sanitize Claude live settings + overwrite Gemini .env
  • fix: fix(codex): align official login preservation with upstream
  • fix: fix(codex): align unified session lifecycle with upstream (#353)
  • fix: fix(codex): infer OpenCode Zen reasoning settings
  • fix: fix(codex): inject unified session bucket on live write
  • fix: fix(codex): preserve custom tool metadata in chat routing
  • …and 280 more

Architecture

  • 0 containers · 1 bounded contexts · 0 dependency edges (baseline)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

SaladDay/cc-switch-cli was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7f073adccabed2613e29c46636b5d000f301494f — the exact code this score is about.
  • Scored under rubric-2026.09.11 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-2e03d42d685b.