Communitygithub.com

CLI 通用 CC Switch

用於 CC Switch 的 CLI 介面 — 從終端機管理 AI 編碼工具設定。

CLI 通用 CC Switch 是什麼?

此技能提供一個命令列工具 `cli-anything-ccswitch`,可讓開發者與 AI 代理直接從終端管理 CC Switch 桌面應用程式的設定。它支援管理多個 AI 編碼工具(如 Claude Code、Codex、Gemini CLI、OpenCode、OpenClaw 和 Hermes)的提供者配置、MCP 伺服器、代理伺服器、已安裝的技能、API 使用統計與會話。基於 Click 建構並遵循 CLI-Anything 方法論,其 `--json` 輸出模式特別適合 AI 代理進行程式化消費。工具會讀取並寫入位於 `~/.cc-switch/cc-switch.db` 的 SQLite 資料庫,並對 API 金鑰等敏感值進行遮罩處理,確保安全操作。

相容平台✓Claude Code✓Codex CLI~Cursor✓Gemini CLI✓OpenCode
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-ccswitch

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

CC Switch CLI

CC Switch 的命令列包裝工具,CC Switch 是一款桌面應用程式,用於管理多種 AI 編碼工具(Claude Code、Codex、Gemini CLI、OpenCode、OpenClaw、Hermes)的設定。採用 Click 與 CLI-Anything 方法論建構。

前置需求

  • Python 3.10+
  • 已安裝 CC Switch,並在 ~/.cc-switch/cc-switch.db 擁有作用中的資料庫

安裝

pip install -e .

安裝完成後,即可使用 cli-anything-ccswitch 指令。

指令群組

群組說明
status顯示資料庫概覽
providers管理 AI 提供者設定(列出、取得、設定目前使用)
proxy管理本機 HTTP 代理伺服器(狀態、設定)
mcp管理 MCP(模型上下文協定)伺服器(列出、啟用)
skills管理已安裝的技能(列出、儲存庫)
usage檢視 API 用量與成本統計(統計、記錄)
settings檢視與管理 CC Switch 設定(列出、取得、設定)
sessions瀏覽與搜尋 AI 對話會話(列出)

全域選項

  • --json — 以機器可讀的 JSON 格式輸出(建議代理使用)
  • --db PATH — 覆蓋資料庫路徑

代理專用指引

JSON 輸出

請一律使用 --json 以利程式化處理。請將它放在子指令之前:

cli-anything-ccswitch --json providers list
cli-anything-ccswitch --json usage stats --days 30
cli-anything-ccswitch --json providers get <id> --app claude

敏感值

所有輸出中的 API 令牌、金鑰與機密都會被遮罩。提供者詳細資料中的 settings_config 欄位會顯示遮罩後的值(例如 sk-bc089...5cbb)。

結束代碼

  • 0 — 成功
  • 1 — 錯誤(例如找不到資源、無效的應用程式類型)

應用程式類型

有效的應用程式類型:claude、codex、gemini、opencode、openclaw、hermes。

範例

列出所有提供者

cli-anything-ccswitch providers list
cli-anything-ccswitch --json providers list --app claude

切換啟用的提供者

cli-anything-ccswitch providers set-current <provider-id> --app claude

檢查代理狀態

cli-anything-ccswitch proxy status --app claude
cli-anything-ccswitch proxy config --app claude --set-port 8080

檢視用量統計

cli-anything-ccswitch usage stats --days 7
cli-anything-ccswitch --json usage stats --days 30 --app claude
cli-anything-ccswitch usage logs --limit 10

列出技能

cli-anything-ccswitch skills list
cli-anything-ccswitch skills repos

MCP 伺服器

cli-anything-ccswitch mcp list
cli-anything-ccswitch mcp enable <server-id> --app claude --on

設定

cli-anything-ccswitch settings list
cli-anything-ccswitch settings get <key>
cli-anything-ccswitch settings set <key> <value>

會話

cli-anything-ccswitch sessions list --app claude --limit 10

狀態概覽

cli-anything-ccswitch status
cli-anything-ccswitch
cli-anything-ccswitch --json

錯誤處理

當找不到資源時,CLI 會將錯誤訊息輸出到標準錯誤(stderr),並以結束代碼 1 退出。代理應在解析輸出前檢查結束代碼。

資料庫

CLI 會讀取執行中的 CC Switch SQLite 資料庫。所有讀取操作均安全且不會修改資料庫。寫入操作(providers set-current、proxy config、mcp enable、settings set)會直接修改資料庫。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

cli-anything-inkscape

>-

相關技能