配置同步工具

将Claude Code的配置同步到Gemini CLI和Codex CLI,确保在切换AI编码助手时工具和知识环境的一致性。

  • by joneshong-skills
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 joneshong-skills/sync-config

使用说明

英语 | 繁体中文

同步配置

将Claude Code配置同步到Gemini CLI和Codex CLI,确保在AI编码助手之间切换时有一致的工具和知识环境。

它做什么

此技能将以下项目从Claude Code同步到其他CLI:

项目 Gemini CLI Codex CLI
MCP服务器 是 是
技能(SKILL.md) 是 是
项目说明(CLAUDE.md) 是(GEMINI.md) 是的(AGENTS.md)
海关代理 是 否
Hooks 是(事件名称映射) 否

关键行为:

  • 主控程序:首选目标CLI mcp add 指挥;回到直接编辑配置文件。
  • 技能:复制整个技能目录,保留 scripts/ 和 references/。自动跳过 sync-config 它本身和CLI特定的技能。
  • 说明:副本 CLAUDE.md 作为 GEMINI.md / AGENTS.md 带有同步标记注释。
  • 代理:将frontmatter(工具名称、结构)转换为Gemini格式。
  • 钩子:将Claude Code事件名称映射到Gemini等效名称(例如。, PreToolUse 到 BeforeTool).

安装

将此存储库克隆到您的Claude Code技能目录中:

git clone https://github.com/joneshong-skills/sync-config.git ~/.claude/skills/sync-config

需要Python 3。

用法

设置快捷方式:

SC="~/.local/bin/python3 ~/.claude/skills/sync-config/scripts/sync_config.py"

常用命令

# View cross-CLI sync status
$SC status

# Sync MCP servers to all targets
$SC sync mcp

# Sync skills (all portable ones)
$SC sync skills

# Sync project instructions (run inside a project directory)
$SC sync instructions

# Sync everything at once
$SC sync all

# Target a specific CLI
$SC sync mcp --target gemini
$SC sync all --target codex

选择性技能同步

# Only sync specific skills
$SC sync skills --include team-tasks,openclaw-mentor

# Exclude specific skills
$SC sync skills --exclude create-skill

项目结构

sync-config/
├── SKILL.md                        # Skill definition
├── README.md                       # This file
├── scripts/
│   ├── sync_config.py              # Main entry point
│   ├── sync_antigravity.py              # Antigravity CLI sync logic
│   └── sync_codex.py               # Codex CLI sync logic
├── references/
│   └── format-mapping.md           # Config format mapping reference
└── examples/
    └── sync-demo.sh                # Full sync workflow demo

许可证

麻省理工学院