Grok Switch is a lightweight local desktop switcher and control plane for Grok CLI.
It manages third-party relay providers, official multi-account sessions, MCP servers, Skills, and local proxy failover pools the way CC Switch does for Claude Code — with complete privacy and zero credential exfiltration.
中文说明见下方 中文文档。
| Feature | Capability |
|---|---|
| Relay Providers | Create, edit, test, duplicate, and delete OpenAI-compatible & Anthropic-compatible relays |
| One-Click Enable | Writes managed gs-* model sections into ~/.grok/config.toml without touching custom configs |
| Official Multi-Account | Capture grok login sessions and switch between multiple official accounts seamlessly |
| Local Reverse Proxy | Built-in 127.0.0.1 OpenAI-compatible proxy with auto-failover (401/403/429/5xx), cooldowns & SQLite telemetry |
| Failover Pool | Priority (P0..Pn), weights (w100), round-robin & automatic cooldown for high-availability routing |
| MCP Management | Manage [mcp_servers.*] in ~/.grok/config.toml (stdio & Streamable HTTP), health probe & toggle |
| Skills Library | Manage ~/.grok/skills (SKILL.md), import from ~/.cc-switch/skills, automatic pre-delete backups |
| CC Switch Import | One-click import of providers, MCP servers, and prompt snippets from ~/.cc-switch |
| JSON Export & Import | Export safe provider metadata (without secrets) and import provider catalogs |
| Health Checks | Pre-switch health probing for chat_completions, responses, and messages backends |
| Automatic Backups | Auto-backup before every switch; one-click instant rollback from the UI |
| Desktop UX | System tray menu with quick-switch, single-instance focus lock, dark/light theme, OS autostart |
| Privacy & Security | All credentials stay in local ~/.grok-switch/ storage; all UI views and logs mask secrets |
| Shortcut | Action |
|---|---|
| Ctrl + 1 | Overview page |
| Ctrl + 2 | Providers page |
| Ctrl + 3 | Official Accounts page |
| Ctrl + 4 | CC Switch Import page |
| Ctrl + 5 | Skills page |
| Ctrl + 6 | MCP page |
| Ctrl + 7 | Activity & Backups page |
| Ctrl + 8 / Ctrl + , | Settings page |
| Ctrl + R | Refresh CLI and local state |
| Ctrl + T | Launch terminal with active Grok model |
┌─────────────────────────┐
│ React 19 Frontend │ SaaS-style UI · Shortcuts · Tray Bridge
└────────────┬────────────┘
│ Tauri IPC (invoke)
┌────────────▼────────────┐
│ Rust Core │ TOML Writer · Proxy · Vault · Health · MCP · Skills
└────────────┬────────────┘
│ Local Filesystem & SQLite
┌────────────▼──────────────────────────────────────────────┐
│ ~/.grok-switch/ App catalog, vault, logs, DB │
│ ~/.grok/config.toml Managed gs-* models & mcp_servers│
│ ~/.grok/auth.json Active official login session │
│ ~/.grok/skills/ Active user skills directory │
│ ~/.cc-switch/ Optional import source (read) │
└───────────────────────────────────────────────────────────┘
Managed model entries are prefixed with gs-:
[endpoints]
models_base_url = "https://your-relay.example/v1"
[models]
default = "gs-my-relay-grok45"
[model.gs-my-relay-grok45]
model = "grok-4.5"
base_url = "https://your-relay.example/v1"
api_key = "sk-..."
api_backend = "chat_completions"
context_window = 1000000Then in your terminal:
grok -m gs-my-relay-grok45
# or run with inline prompt
grok -p "hello" -m gs-my-relay-grok45- Windows 10/11 (macOS / Linux compatible core)
- Node.js 18+ & npm
- Rust 1.80+ via rustup (for desktop compilation)
- Grok CLI installed (
grok.exein PATH or~/.grok/bin/grok.exe)
git clone https://github.com/ibi6/grok-switch.git
cd grok-switch
npm install
npm run tauri:devFrontend-only preview (mock API without mutating Grok configuration):
npm run dev
# Open http://localhost:1420npm run tauri:buildGenerated installer artifacts:
- NSIS installer:
src-tauri/target/release/bundle/nsis/*.exe - MSI package:
src-tauri/target/release/bundle/msi/*.msi
Grok Switch uses automated GitHub Actions workflows for continuous delivery.
To create a release, update versions in package.json, src-tauri/Cargo.toml, and src-tauri/tauri.conf.json, then push a git tag:
git tag v0.1.2
git push origin v0.1.2The CI workflow automatically validates metadata consistency across all files and publishes Windows MSI & NSIS installer assets to the GitHub release.
- Navigate to Providers (
Ctrl+2) → Click Add. - Enter Provider Name, Base URL (supports auto
/v1completion or full URL mode), and API Key. - Choose the protocol (
chat_completions,responses, ormessages). - Click Test to verify network connectivity, then click Save & Enable.
- Click the copyable model badge (
gs-...) to copy the CLI model flag directly.
- In Settings (
Ctrl+8), configure the local proxy port (default:18765) and pool strategy (priority,weighted,round_robin). - Toggle Start Local Proxy.
- Grok Switch rewrites
endpoints.models_base_urltohttp://127.0.0.1:18765/v1. - If an upstream provider returns 401, 403, 429, or 5xx, the proxy automatically cools down the failing provider for 30s and retries the request against the next eligible provider in the pool.
- Inspect request logs, latency, and token consumption under Activity & Backups (
Ctrl+7).
- In your terminal, run
grok loginto authenticate with xAI. - Open Official Accounts (
Ctrl+3) → Click Capture. - Switch between captured official accounts at any time; Grok Switch safely replaces
~/.grok/auth.jsonand resets default models.
- Skills: Create or import Markdown skill packages (
SKILL.md) to~/.grok/skills/. Use them in the Grok CLI with/skill-name. - MCP Servers: Configure stdio (e.g.
npx @modelcontextprotocol/server-filesystem) or Streamable HTTP servers. Test connectivity and toggle servers on/off without restarting your machine.
- 100% Local: No telemetry, accounts, or API keys leave your machine.
- Credential Masking: API keys and environment secrets are masked in UI and activity logs.
- Safe JSON Export: Provider JSON export strips credentials by default to prevent accidental leakage when sharing presets.
- Disclaimers: Grok Switch is an independent open-source utility and is not affiliated with xAI.
Grok Switch 是面向 Grok CLI 的本地桌面切换与控制面板(对标 Claude Code 生态的 CC Switch)。
全面支持中转供应商管理、官方多账号会话切换、MCP 服务器与 Skills 包管理、本地高可用代理与故障自动转移。
- 中转供应商:支持 OpenAI Chat Completions、Responses API 以及 Anthropic Messages 协议,一键写入
~/.grok/config.toml。 - 官方多账号:捕获终端
grok login登录态快照,支持在多个官方账号间无缝切换。 - 本地高可用代理:内置
127.0.0.1反向代理,支持 401/403/429/5xx 故障自动转移(Failover)与自动冷却,自动记录请求延迟与 Token 统计。 - 供应商池策略:支持优先级(Priority)、权重(Weight)、轮询(Round-Robin)调度。
- MCP 服务器管理:可视化管理
config.toml中的[mcp_servers.*](stdio / Streamable HTTP),支持一键探测与启停。 - Skills 技能库:管理
~/.grok/skills/<name>/SKILL.md,支持从 CC Switch 一键同步,删除前自动本地备份。 - CC Switch 一键导入:从
~/.cc-switch快速导入供应商、MCP 配置及常用提示词。 - 安全备份与回滚:每次切换前自动备份
config.toml与auth.json,支持一键无损回滚。 - 桌面体验:系统托盘菜单快捷切换、单实例防重开置顶、深色/浅色/跟随系统主题、开机静默自启。
- 隐私防护:所有密钥与凭证仅存放于本地
~/.grok-switch/,导出与日志自动脱敏。
| 快捷键 | 功能 |
|---|---|
| Ctrl + 1 | 总览页面 |
| Ctrl + 2 | 供应商管理 |
| Ctrl + 3 | 官方账号 |
| Ctrl + 4 | CC Switch 导入 |
| Ctrl + 5 | Skills 技能库 |
| Ctrl + 6 | MCP 服务器 |
| Ctrl + 7 | 日志与备份 |
| Ctrl + 8 / Ctrl + , | 设置 |
| Ctrl + R | 刷新状态 |
| Ctrl + T | 打开 Grok 终端 |
git clone https://github.com/ibi6/grok-switch.git
cd grok-switch
npm install
npm run tauri:dev启用供应商后在终端中使用:
grok -m gs-<模型ID>MIT © Grok Switch contributors