Claude Code ecosystem switcher
Project description
cc-eco
Claude Code 生态切换工具,在 CC Switch 之上增加生态维度,实现 Superpowers / GSD / ... 的完全隔离与快速切换。
核心理念
存档/读档模式:每个生态保存完整的 DB 状态快照(db-state.json),切换时直接保存当前状态、恢复目标状态,不依赖推算。
安装
# 方式一:pip 安装(推荐)
pip3 install cc-eco
# 方式二:一键安装
curl -fsSL https://raw.githubusercontent.com/nicekai-jpg/cc-eco/main/install.sh | bash
用法
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
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
File details
Details for the file cc_eco-3.1.0.tar.gz.
File metadata
- Download URL: cc_eco-3.1.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0672f0bdc9ddf04ae468c57b112c52a294365b66c3a9d0c9e6d3cdfaf1f71572
|
|
| MD5 |
649abd456aee1abd69cb38e79f27e646
|
|
| BLAKE2b-256 |
c2b80c09a1eceaa289f59989c2903911ab5099f2827428f89bea0875cc916d8a
|
Provenance
The following attestation bundles were made for cc_eco-3.1.0.tar.gz:
Publisher:
publish.yml on nicekai-jpg/cc-eco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_eco-3.1.0.tar.gz -
Subject digest:
0672f0bdc9ddf04ae468c57b112c52a294365b66c3a9d0c9e6d3cdfaf1f71572 - Sigstore transparency entry: 1631907274
- Sigstore integration time:
-
Permalink:
nicekai-jpg/cc-eco@59cadd44e6cd665f7943ea31441f9e8c896813d2 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/nicekai-jpg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@59cadd44e6cd665f7943ea31441f9e8c896813d2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cc_eco-3.1.0-py3-none-any.whl.
File metadata
- Download URL: cc_eco-3.1.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff0eb3fcba1ccc8ab32a26762b5e6fb9bce5e8c943110b17ca0d158cde42dc4e
|
|
| MD5 |
1e8eecea29072860cea291d046502f0b
|
|
| BLAKE2b-256 |
4f743ba480dcb911e78cf9d1e1faad189dad2c51494c050211b07d2346d7eab1
|
Provenance
The following attestation bundles were made for cc_eco-3.1.0-py3-none-any.whl:
Publisher:
publish.yml on nicekai-jpg/cc-eco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_eco-3.1.0-py3-none-any.whl -
Subject digest:
ff0eb3fcba1ccc8ab32a26762b5e6fb9bce5e8c943110b17ca0d158cde42dc4e - Sigstore transparency entry: 1631907297
- Sigstore integration time:
-
Permalink:
nicekai-jpg/cc-eco@59cadd44e6cd665f7943ea31441f9e8c896813d2 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/nicekai-jpg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@59cadd44e6cd665f7943ea31441f9e8c896813d2 -
Trigger Event:
release
-
Statement type: