kb-sync
v0.0.1
Published
一个通用的命令行工具,用于同步远程 Markdown 知识库文件到本地项目
Readme
kb-sync
一个通用的命令行工具,用于同步远程 Markdown 知识库文件到本地项目。
安装
全局安装
npm install -g kb-sync使用 npx(推荐)
npx kb-sync使用方法
1. 创建配置文件
在项目根目录创建 .kb-sync.json 配置文件:
{
"sources": [
{
"url": "https://raw.githubusercontent.com/example/docs/main/api-guide.md",
"localPath": "./docs/reference/api-guide.md"
},
{
"url": "https://raw.githubusercontent.com/example/docs/main/getting-started.md",
"localPath": "./docs/getting-started.md"
}
],
"options": {
"overwrite": true,
"createMissingDirectories": true
}
}2. 运行同步
npx kb-sync配置文件说明
sources 数组
每个源文件对象包含:
url: 远程文件的 URLlocalPath: 本地保存路径
