dcd-ruyi-workflow
v0.1.0
Published
Sync bundled scaffold templates (global knowledge & coco agents) into the current working directory.
Readme
dcd-ruyi-workflow
一个零依赖的脚手架同步 CLI,把内置的模板目录同步到当前工作目录(process.cwd())。缺失则补齐,已存在则按策略处理。
用途
它内置两份模板,运行时同步到当前目录:
| 模板目录 (包内) | 同步到的目标路径 (cwd) |
| --------------------------- | ---------------------- |
| templates/global-knowledge | .global-knowledge |
| templates/coco-agents | .coco/agents |
模板目录名去掉了前导点(用
global-knowledge/coco-agents),以规避 npm 发布时对 dotfile / dot-dir 的过滤问题;CLI 内部维护映射表,将其还原为带点的目标路径。
用法
# 在你的项目根目录执行
npx dcd-ruyi-workflow选项
| 选项 | 含义 |
| --------------- | ------------------------------------------------------ |
| -f, --force | 目标已存在时直接覆盖(先删除目标再整目录拷贝) |
| -s, --skip | 目标已存在时跳过 |
| -m, --merge | 目标已存在时仅补齐缺失的文件,不覆盖用户已有文件 |
| -y, --yes | 非交互模式;若未指定具体策略,默认按 merge 处理 |
| -h, --help | 打印用法 |
已存在时的行为
- 目标不存在:递归拷贝整个模板目录,输出
added: <target>。 - 目标已存在:
- 交互模式(TTY 且未指定策略):提示
[s]kip / [o]verwrite / [m]erge,按输入处理。 overwrite:删除目标后整目录拷贝。merge:仅拷贝目标中不存在的文件,保留用户已有文件,并列出补齐了哪些文件。skip:跳过。
- 交互模式(TTY 且未指定策略):提示
结束时打印一行 summary:added / overwritten / merged / skipped 各多少。
发布
# 校验打包内容(不会真正发布)
npm pack --dry-run
# 发布为公开包
npm publish --access public