cli-anything-ccswitch
它能做什么
这个技能让智能体检查和管理 CC Switch 所控制的 AI 编程工具的设置,例如 Claude Code 和 Codex。适合在不同服务商和工具之间切换的开发者。
适用场景
- ✓当你想查看你的编程工具当前使用哪个 AI 服务商的时候。
- ✓当你想为某个 AI 编程工具切换当前服务商的时候。
- ✓当你想查看编程工具的 API 用量和费用统计的时候。
技能链接
https://github.com/HKUDS/CLI-Anything/blob/main/cc-switch/agent-harness/cli_anything/ccswitch/skills/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请告诉我我的编程工具正在使用哪个 AI 服务商,以及过去三天它们的费用。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会读取你电脑上的 CC Switch 数据库,并运行其命令行工具来列出或修改设置。它还可以显示用量日志,并浏览过去的会话。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
CC Switch CLI
CLI harness for CC Switch, a desktop app that manages AI coding tool (Claude Code, Codex, Gemini CLI, OpenCode, OpenClaw, Hermes) configurations. Built with Click and the CLI-Anything methodology.
Prerequisites
- Python 3.10+
- CC Switch installed with an active database at
~/.cc-switch/cc-switch.db
Installation
pip install -e .
After installation, the command cli-anything-ccswitch is available.
Command Groups
| Group | Description |
|---|---|
status |
Show a quick database overview |
providers |
Manage AI provider configurations (list, get, set-current) |
proxy |
Manage the local HTTP proxy server (status, config) |
mcp |
Manage MCP (Model Context Protocol) servers (list, enable) |
skills |
Manage installed skills (list, repos) |
usage |
View API usage and cost statistics (stats, logs) |
settings |
View and manage CC Switch settings (list, get, set) |
sessions |
Browse and search AI conversation sessions (list) |
Global Options
--json— Output in machine-readable JSON format (recommended for agent use)--db PATH— Override the database path
Agent-Specific Guidance
JSON Output
Always use --json for programmatic consumption. Place it before the
subcommand:
cli-anything-ccswitch --json providers list
cli-anything-ccswitch --json usage stats --days 30
cli-anything-ccswitch --json providers get <id> --app claude
Sensitive Values
API tokens, keys, and secrets are masked in all output. The settings_config
field in provider details shows masked values (e.g., sk-bc089...5cbb).
Exit Codes
0— Success1— Error (e.g., resource not found, invalid app type)
App Types
Valid app types: claude, codex, gemini, opencode, openclaw, hermes.
Examples
List all providers
cli-anything-ccswitch providers list
cli-anything-ccswitch --json providers list --app claude
Switch active provider
cli-anything-ccswitch providers set-current <provider-id> --app claude
Check proxy status
cli-anything-ccswitch proxy status --app claude
cli-anything-ccswitch proxy config --app claude --set-port 8080
View usage stats
cli-anything-ccswitch usage stats --days 7
cli-anything-ccswitch --json usage stats --days 30 --app claude
cli-anything-ccswitch usage logs --limit 10
List skills
cli-anything-ccswitch skills list
cli-anything-ccswitch skills repos
MCP servers
cli-anything-ccswitch mcp list
cli-anything-ccswitch mcp enable <server-id> --app claude --on
Settings
cli-anything-ccswitch settings list
cli-anything-ccswitch settings get <key>
cli-anything-ccswitch settings set <key> <value>
Sessions
cli-anything-ccswitch sessions list --app claude --limit 10
Status overview
cli-anything-ccswitch status
cli-anything-ccswitch
cli-anything-ccswitch --json
Error Handling
When a resource is not found, the CLI prints an error message to stderr and exits with code 1. Agents should check the exit code before parsing output.
Database
The CLI reads from the live CC Switch SQLite database. All read operations
are safe and do not modify the database. Write operations (providers set-current, proxy config, mcp enable, settings set) modify the
database directly.
常见问题
我需要安装 CC Switch 吗?
需要。你的电脑上必须安装 CC Switch,并且有可用的数据库。
它涵盖哪些工具?
它涵盖 Claude Code、Codex、Gemini CLI、OpenCode、OpenClaw 和 Hermes。
它能修改设置吗?
可以。它可以设置当前服务商,启用 MCP 服务器,以及进行其他修改。
详情
作者的原始描述
CLI interface for CC Switch — manage AI coding tool configurations from the terminal
repo: HKUDS/CLI-Anything
热度
- GitHub 星标
- 58k
- 排名
- #3187
- 许可证
- Apache-2.0
- 更新时间
- 2026/9/21
评论
- …
同一仓库的更多技能
cli-anything-3mf
58k帮你的智能体检查和修复 3D 打印文件,包括查找圆孔、调整孔径、修复网格,以及比较两个文件。
cli-anything-qgis
58k帮你的智能体在终端中打开、编辑和导出 QGIS 地图项目,包括图层、要素、打印布局和处理工具。
cli-anything-adguardhome
58k帮你的智能体管理 AdGuard Home,这是一款全网络广告拦截器,可管理过滤规则、DNS 重写、客户端和查询日志。
cli-anything-anygen
58k帮你的智能体借助 AnyGen 服务,根据文字提示生成幻灯片、文档、网站和图表。