CLI tool for managing multiple Claude Code settings profiles. Switch between different ~/.claude/settings.json configurations for different contexts.
npm install claude-code-contextCLI 工具,用於管理多組 Claude Code settings。可在不同情境(工作、個人、專案)之間快速切換 ~/.claude/settings.json 設定。
``bash`
brew tap tim80411/tap
brew install ccx
更新:
`bash`
brew update
brew upgrade ccx
`bash`
git clone
cd ccx
bun install
bun link
從目前的 Claude Code 設定建立新的 setting:
`bash`
ccx setting create 例如: ccx setting create work
`bash`
ccx setting list
切換到指定的 setting(會自動備份目前設定到 previous):
`bash`
ccx setting use 例如: ccx setting use personal
未指定名稱時,會進入互動選擇模式:
`bash`
ccx setting use
顯示目前使用中的 setting 名稱:
`bash`
ccx setting status
用目前的 Claude Code 設定覆蓋指定的 setting:
`bash`
ccx setting update 例如: ccx setting update work
未指定名稱時,會更新當前使用中的 setting(需確認):
`bash`
ccx setting update
顯示當前 setting 的檔案路徑:
`bash`
ccx setting path
顯示 Claude 官方設定檔路徑:
`bash`
ccx setting path --official
顯示當前 setting 的內容:
`bash`
ccx setting show
ccx setting show --raw # 輸出非格式化的 JSON
顯示 Claude 官方設定檔內容:
`bash`
ccx setting show --official
比較當前 setting 與 Claude 官方設定:
`bash`
ccx setting diff
比較指定 setting 與 Claude 官方設定:
`bash`
ccx setting diff 例如: ccx setting diff work
比較兩個 setting:
`bash`
ccx setting diff 例如: ccx setting diff work personal
使用語意化輸出(依 added/removed/modified 分組):
`bash`
ccx setting diff --semantic
| 變數 | 說明 |
|------|------|
| CLAUDE_CONFIG_DIR | 自訂 Claude 設定目錄路徑(預設為 ~/.claude) |
| 用途 | 路徑 |
|------|------|
| Claude Code 設定 | ~/.claude/settings.json |~/.config/ccx/settings/
| 儲存的 Settings | |~/.config/ccx/settings/previous.json
| 自動備份 | |~/.config/ccx/state.json
| 狀態追蹤 | |
`bash執行測試
bun test
MIT