plugin-replicator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Plugin Replicator

Plugin Replicator 插件复制工具

Overview

概述

Primarily a developer machine tool. Use this when you have multiple local projects and want to keep plugin source code in sync between them without manual copying.
It is bidirectional — source and destination are just paths, so it works as both a push (distribute updates outward) and pull (pull latest into a consumer project):
PUSH (run from agent-plugins-skills):
  plugins/X  ->  /other-project/plugins/X

PULL (run from the consumer project):
  /agent-plugins-skills/plugins/X  ->  plugins/X
After replicating, run
plugin-maintenance
Sync in the target project to activate plugins in
.agent/
,
.claude/
,
.gemini/
etc.
这是一款主要面向开发者的本地工具。 当你有多个本地项目,希望无需手动复制即可在项目间同步插件源代码时可以使用该工具。
它是双向的——源端和目标端仅为路径,因此既支持推送(向外分发更新)也支持拉取(将最新版本拉取到使用项目中):
PUSH (在agent-plugins-skills目录下运行):
  plugins/X  ->  /other-project/plugins/X

PULL (在使用插件的项目目录下运行):
  /agent-plugins-skills/plugins/X  ->  plugins/X
复制完成后,在目标项目中运行
plugin-maintenance
Sync命令,以在
.agent/
.claude/
.gemini/
等目录下激活插件。

References

参考资料

  • Overview:
    plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_overview.md
  • Flow diagram:
    plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_diagram.mmd

  • 概述:
    plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_overview.md
  • 流程图:
    plugins/plugin-manager/skills/plugin-replicator/references/plugin_replicator_diagram.mmd

Modes

运行模式

ModeFlagBehavior
Additive(default)Copies new/updated files only. Nothing deleted from dest.
Clean Sync
--clean
Copies new/updated AND removes dest files missing from source.
Symlink
--link
Creates a live symlink — always reflects source. Best for dev.
Preview
--dry-run
Prints what would happen without making changes.

模式参数行为
增量更新(默认)仅复制新增/更新的文件,不会删除目标路径下的任何内容。
完全同步
--clean
复制新增/更新文件,同时删除源路径中不存在的目标路径文件。
符号链接
--link
创建实时符号链接——内容始终与源端保持一致,最适合开发场景使用。
预览
--dry-run
打印预计执行的操作,但不会实际修改任何内容。

Execution Protocol

执行流程

CRITICAL: Do not immediately generate bash commands. Operate as an interactive assistant.
重要提示: 不要直接生成bash命令,需作为交互式助手运行。

Phase 1: Guided Discovery

阶段1:引导确认

Ask the user:
  1. Source: Which plugin(s)? Single plugin or bulk sync of all?
  2. Destination: What is the absolute path to the target project's
    plugins/
    folder?
  3. Mode: Additive update (safe default), Clean sync (also removes deleted files), or Symlink (dev)?
  4. Preview first?: Recommend
    --dry-run
    for the first run.
询问用户以下信息:
  1. 源端:需要同步哪些插件?单个插件还是批量同步所有插件?
  2. 目标端:目标项目
    plugins/
    文件夹的绝对路径是什么?
  3. 运行模式:增量更新(安全默认选项)、完全同步(同时移除已删除文件)还是符号链接(开发场景)?
  4. 是否先预览?:首次运行推荐使用
    --dry-run
    参数。

Phase 2: Recap-Before-Execute

阶段2:执行前确认

markdown
undefined
markdown
undefined

Proposed Replication Task

拟执行的复制任务

  • Plugin(s): [name or ALL]
  • Source:
    plugins/<name>/
    (this repo)
  • Destination:
    [absolute path]
  • Mode: [Additive / Clean / Symlink] [DRY RUN?]
Confirm to proceed.
undefined
  • 插件: [名称或ALL]
  • 源路径:
    plugins/<name>/
    (当前仓库)
  • 目标路径:
    [绝对路径]
  • 模式: [增量更新 / 完全同步 / 符号链接] [是否试运行?]
请确认后继续执行。
undefined

Phase 3: Command Generation

阶段3:生成命令

Pull: From
agent-plugins-skills
into a consumer project (run FROM consumer project)

拉取:从
agent-plugins-skills
拉取到使用项目(在使用项目目录下运行)

bash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
  --source /Users/richardfremmerlid/Projects/agent-plugins-skills/plugins/<plugin-name> \
  --dest plugins/<plugin-name> \
  --clean
bash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
  --source /Users/richardfremmerlid/Projects/agent-plugins-skills/plugins/<plugin-name> \
  --dest plugins/<plugin-name> \
  --clean

Push: From this repo to another project (run FROM this repo)

推送:从当前仓库推送到其他项目(在当前仓库目录下运行)

bash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
  --source plugins/<plugin-name> \
  --dest /path/to/other-project/plugins/<plugin-name>
bash
python3 plugins/plugin-manager/scripts/plugin_replicator.py \
  --source plugins/<plugin-name> \
  --dest /path/to/other-project/plugins/<plugin-name>

Bulk Push: All plugins

批量推送:所有插件

bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
  --source plugins/ \
  --dest /path/to/other-project/plugins/
bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
  --source plugins/ \
  --dest /path/to/other-project/plugins/

Filtered Bulk (e.g., only obsidian-* plugins)

过滤批量推送(例如仅同步obsidian-*开头的插件)

bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
  --source plugins/ \
  --dest /path/to/other-project/plugins/ \
  --filter "obsidian-*" --clean

bash
python3 plugins/plugin-manager/scripts/bulk_replicator.py \
  --source plugins/ \
  --dest /path/to/other-project/plugins/ \
  --filter "obsidian-*" --clean

When to Use

适用场景

  • New project setup: Bulk-replicate all plugins to get started fast.
  • Plugin update: Additive sync to push latest changes to a consumer project.
  • Removing a skill/file: Run with
    --clean
    to propagate deletions.
  • Active development: Use
    --link
    to work from source and test in target instantly.
  • 新项目初始化:批量复制所有插件,快速启动开发。
  • 插件更新:通过增量同步将最新变更推送到使用项目。
  • 移除技能/文件:使用
    --clean
    参数运行,同步删除操作。
  • 活跃开发阶段:使用
    --link
    参数,基于源端开发即可在目标项目即时测试。

Next Actions

后续操作

After replicating, run
plugin-maintenance
Sync in the target project to activate the plugins in
.agent/
,
.claude/
,
.gemini/
etc.
复制完成后,在目标项目中运行
plugin-maintenance
Sync命令,以在
.agent/
.claude/
.gemini/
等目录下激活插件。