Skip to main content

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.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cc_eco-3.0.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file cc_eco-3.0.0.tar.gz.

File metadata

  • Download URL: cc_eco-3.0.0.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

Hashes for cc_eco-3.0.0.tar.gz
Algorithm Hash digest
SHA256 02e735288305e1ee0a45be5facf8b374d5440547ec135826d384d5f9a2682d8e
MD5 715028baa25595f0e15003c0b0185111
BLAKE2b-256 d8971adc8eb662e0ab7282b3b20bace7107f7d8a69fdf791db4dbc8a7b538794

See more details on using hashes here.

File details

Details for the file cc_eco-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: cc_eco-3.0.0-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

Hashes for cc_eco-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88e1e98b5ae949d4582953c19c5c6be19d69c83431385c276405c12c6112265c
MD5 f8745a8e75078725551e9985701051e1
BLAKE2b-256 08b67a6d9aff8c562196ef0cc7e5589c81fe5b1170b5f2f84122459db9f2768e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page