CodeVetter · Repo Unpack · Feature catalog
farion1231/cc-switch
The shell in App.tsx is a single window with an app switcher and views for providers, settings, prompts, skills, MCP, agents, universal providers, sessions, workspace files, OpenClaw env/tools/agent defaults, and Hermes memory. Provider management is the primary surface: presets, add/edit/delete, drag sort, tray switching, and per-provider terminals. Four apps can be taken over by a local proxy with failover and circuit breaking. Cross-tool panels cover MCP, Skills, and prompts. Extra utilities include usage scripts, subscription and coding-plan quotas, session browsing, WebDAV and S3 sync, deep-link import, env-conflict checks, and Claude Desktop direct versus proxy routing.
- README positions the app as one manager for Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes, and MiniMax Code, with provider presets, unified MCP and Skills, tray switching, and cloud sync via Dropbox, OneDrive, iCloud, or WebDAV. The user manual TOC matches providers, MCP, prompts, skills, sessions, workspace, proxy takeover, failover, and usage.
- App view union is providers, settings, prompts, skills, skillsDiscovery, mcp, agents, universal, sessions, workspace, openclawEnv, openclawTools, openclawAgents, and hermesMemory. Last app and last view persist in localStorage keys cc-switch-last-app and cc-switch-last-view. Default app is claude. claude-desktop shares feature panels with claude via sharedFeatureApp.
- providersApi exposes getAll, getCurrent, add, update, delete, removeFromLiveConfig, switch, importDefault, Claude Desktop import/status, official-provider seed ensure for Claude Desktop, Codex, and Grok Build, tray refresh, sort order, provider-switched events, and openTerminal. OpenCode, OpenClaw, and Hermes also have live-id and import-from-live helpers.
- Preset catalogs live in src/config as separate modules: claudeProviderPresets, claudeDesktopProviderPresets, codexProviderPresets, geminiProviderPresets, grokBuildProviderPresets, hermesProviderPresets, mcodeProviderPresets, openclawProviderPresets, opencodeProviderPresets, piProviderPresets, plus universalProviderPresets, mcpPresets, and codingPlanProviders. ProviderPreset fields include settingsConfig, apiKeyField, endpointCandidates, category, and partner flags.
- Universal providers are one shared config stored under settings key universal_providers and synced to Claude, Codex, and Gemini. Commands include get_universal_providers, upsert_universal_provider, delete_universal_provider, and sync_universal_provider.
- The local proxy default listen address is 127.0.0.1:15721 with per-app rows for claude, codex, gemini, and grokbuild. Routes include /v1/messages, /claude-desktop/v1/messages, OpenAI chat/completions and responses (with /codex and /v1/v1 prefixes), /grokbuild/v1/responses, /alpha/search, and image generations. Frontend PROXY_APP_IDS matches those four apps.
- Proxy commands split start (no live rewrite) from set_proxy_takeover_for_app, stop_proxy_server (refuses while any takeover flag is set, including opencode and openclaw fields), and stop_proxy_with_restore. Failover commands cover queue membership, auto-failover toggle, circuit-breaker config, reset, and stats.
- CircuitState is Closed, Open, or HalfOpen. CircuitBreakerConfig uses failure_threshold, success_threshold, timeout_seconds, error_rate_threshold, and min_requests. ProviderRouter::select_providers returns only the current provider when auto-failover is off, otherwise the failover queue. Codex official providers are excluded from failover so an inbound Authorization header is not retried against another account.
- Unified MCP commands are get_mcp_servers, upsert_mcp_server, delete_mcp_server, toggle_mcp_app, and import_mcp_from_apps. validate_mcp_command only checks that the binary is on PATH and does not execute it. McpApps has flags for claude, codex, gemini, grokbuild, opencode, hermes, and mcode; OpenClaw, Pi, and Claude Desktop are hard-disabled.
- Skills use a unified skills table (id, directory, repo owner/name/branch, per-app enabled flags including pi, content_hash). Commands cover install, uninstall, toggle, scan unmanaged, discover, check updates, zip install, and repo list. SkillApps enables the same apps as MCP plus Pi, and not OpenClaw or Claude Desktop. Prompts have get/upsert/delete/enable plus Pi prompt-file commands.
- Session manager commands are list_sessions, get_session_messages, delete_session(s), launch_session_terminal, get_tool_versions, run_tool_lifecycle_action, and probe_tool_installations. open_provider_terminal launches a terminal with env extracted from that provider's settings_config without requiring it to be current.
- Deep links use resource types provider, prompt, mcp, and skill. DeepLinkImportRequest carries endpoint, apiKey, base64 config, configUrl, and usage-script fields. usageEnabled defaults to unset so a script payload is not itself permission to run it. Parser entry is parse_deeplink_url; import helpers are import_provider_from_deeplink, import_mcp_from_deeplink, import_prompt_from_deeplink, and import_skill_from_deeplink.
- Usage and billing commands include queryProviderUsage, testUsageScript, get_subscription_quota, get_codex_oauth_quota, get_codex_oauth_models, get_xai_oauth_quota, get_xai_oauth_models, get_coding_plan_quota, and get_balance, plus usage summary, trends, request logs, and models.dev pricing sync. Claude plugin commands can apply or clear an onboarding skip and official-vs-third-party plugin config.
- Cloud sync commands are webdav_test_connection, webdav_sync_upload/download, webdav_sync_save_settings, s3_test_connection, s3_sync_upload/download, and s3_sync_save_settings. WebDAV accepts only http/https. S3 uses AWS SigV4, virtual-hosted URLs for amazonaws.com, and path-style URLs for custom endpoints. Local DB backup commands are create/list/restore/rename/delete.
- OpenCode categories omo and omo-slim switch by writing one Oh My OpenCode config and deleting the other. Claude Desktop switches through switch_normal and apply_provider rather than the generic live writer. Pi switch short-circuits to pi::enable. Grok import of an official live config ensures the grokbuild-official seed instead of erroring.