Claude Code ecosystem switcher
Project description
cc-eco
Claude Code 生态切换工具,在 CC Switch 之上增加生态维度,实现 Superpowers / GSD / ... 的完全隔离与快速切换。
核心理念
存档/读档模式:每个生态保存完整的 DB 状态快照(db-state.json),切换时直接保存当前状态、恢复目标状态,不依赖推算。
安装
# 方式一:一键安装(推荐)
curl -fsSL https://raw.githubusercontent.com/limingkai/cc-eco/main/install.sh | bash
# 方式二:pip 安装
pip3 install git+https://github.com/limingkai/cc-eco.git
用法
cc-eco init <name> # 初始化,当前状态存为 <name> 快照
cc-eco snapshot <name> # 从当前生态创建新快照
cc-eco switch <name> # 切换到目标生态(自动重启)
cc-eco switch <name> --no-restart # 切换但不重启
cc-eco status # 显示当前生态状态
cc-eco list # 列出所有生态
cc-eco delete <name> [--force] # 删除生态
cc-eco discover # 发现可能需要隔离的新路径
cc-eco adopt <path> # 将路径加入隔离
cc-eco isolate # 显示当前隔离的路径列表
快速开始
# 1. 初始化(当前状态存为 superpowers 快照)
cc-eco init superpowers
# 2. 创建 gsd 快照
cc-eco snapshot gsd
# 3. 编辑 gsd 的配置
vim ~/.claude-ecosystems/gsd/eco.json
vim ~/.claude-ecosystems/gsd/db-state.json
# 4. 切换到 gsd
cc-eco switch gsd
# 5. 切回 superpowers
cc-eco switch superpowers
隔离的文件
| 路径 | 方式 |
|---|---|
~/.claude/skills/ |
符号链接快照 |
~/.claude/commands/ |
符号链接快照 |
~/.claude/settings.json |
DB 状态恢复后重新生成 |
隔离的 DB 状态
| 表 | 字段 |
|---|---|
skills |
enabled_claude |
mcp_servers |
enabled_claude |
providers |
settings_config(enabledPlugins、hooks) |
settings |
common_config_claude |
切换流程
Phase 1: 存档 — 保存当前 DB 状态到当前生态的 db-state.json
Phase 2: 备份 — 备份 CC Switch 数据库
Phase 3: 读档 — 从目标生态的 db-state.json 恢复 DB 状态
Phase 4: 换传送门 — 替换文件级符号链接
Phase 5: 同步 skills — 删除禁用的、创建启用的符号链接
Phase 6: 重新生成 settings.json
Phase 7: 重启 — 重启 Claude Code 和 CC Switch
跨平台支持
| 平台 | 支持级别 | 说明 |
|---|---|---|
| macOS | 完整 | pkill + open + osascript |
| Linux | 完整 | pkill + xdg-terminal-emulator / 检测终端 |
| Windows | 尽力 | taskkill + os.startfile,符号链接需开发者模式 |
依赖
- CC Switch — Claude Code 配置管理工具
- Python 3.9+ — 运行时(macOS/Linux 自带)
从 v2 升级
v3 与 v2 数据格式完全兼容,无需迁移:
db-state.json格式不变eco.json格式不变~/.claude-ecosystems/目录结构不变
重新运行安装脚本即可升级,旧版 cc-eco.sh 会被自动清理。
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cc_eco-3.0.1.tar.gz
(16.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
cc_eco-3.0.1-py3-none-any.whl
(14.3 kB
view details)
File details
Details for the file cc_eco-3.0.1.tar.gz.
File metadata
- Download URL: cc_eco-3.0.1.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0dfbc2e9e62d06c0a2c52eac0aefca7c1a60b8ef88b647cb04c3237c60d0116
|
|
| MD5 |
ffb22a7f308736ebf0d6c62270020c13
|
|
| BLAKE2b-256 |
ddb377c1f500a11910baa5dc5a974d2c60d2a4d0ce0b14b54545216220558292
|
File details
Details for the file cc_eco-3.0.1-py3-none-any.whl.
File metadata
- Download URL: cc_eco-3.0.1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f1ad59fefe9813ab30b644040ad5ecd5656cc28c5ac29edccb118d0e6aaecc4
|
|
| MD5 |
33f5b3a31e48d6ca134609fbbb625202
|
|
| BLAKE2b-256 |
d8354d2fbbc361e3f70fbf8f1a0f89bfadd041f812eeb1a9eee76f5cc5409d8f
|