Loading...
Loading...
将本地 Markdown 文章发布到微信公众号草稿箱。当用户提到发布文章到公众号、上传 markdown 到微信公众号、或需要将本地文章同步到微信公众号时使用此技能。
npx skill4agent add steelan9199/wechat-publisher wechat-publisher前往使用我的业务/公众号基础信息开发秘钥# Windows 示例
npm install --prefix "C:\Users\YourName\.qoder\skills\wechat-publisher-skill"
# Mac/Linux 示例
npm install --prefix "/Users/yourname/.qoder/skills/wechat-publisher-skill"| 参数 | 必填 | 说明 |
|---|---|---|
| Markdown 文件路径 | 是 | 要发布的文章文件位置 |
| APP_ID | 否 | 微信开发者平台的 AppID |
| APP_SECRET | 否 | 微信开发者平台的 AppSecret |
| 文章作者名称 | 否 | 公众号显示的作者名 |
| 封面图片路径 | 否 | 文章封面图片 |
| 文章标题 | 否 | 发布的文章标题,未指定时使用文件名作为标题 |
| 主题 | 否 | 文章渲染主题,使用 themes 目录下的主题文件(默认使用蓝色主题) |
| 文章前缀 | 否 | 显示在正文开头的内容 |
| 文章后缀 | 否 | 显示在正文结尾的内容 |
所有可选参数均有默认值(来自),用户不提供时自动使用默认值。config.default.json
config.default.jsonconfig.jsonmarkdownFilePathconfig.default.json<技能目录绝对路径>./cover.jpg<技能目录绝对路径>/cover.jpg{
"markdownFilePath": "用户提供的markdown文章路径",
"title": "文章标题,未指定时使用文件名作为标题",
"theme": "文章渲染主题,使用themes目录下的主题文件名(默认使用蓝色主题)",
"AUTHOR": "文章作者名称",
"prefix": "文章前缀",
"suffix": "文章后缀",
"APP_ID": "微信开发者平台的APP_ID",
"APP_SECRET": "微信开发者平台的APP_SECRET",
"coverFilePath": "文章的封面路径"
}{
"markdownFilePath": "D:\\Documents\\公众号教程\\文章.md",
"title": "文章标题",
"theme": "blue",
"AUTHOR": "牙叔教程",
"prefix": "本文由AI创作\n",
"suffix": "## 扣子智能体教程\nhttps://space.bilibili.com/26079586",
"APP_ID": "wxc2afxxxxxxxxxx",
"APP_SECRET": "8c05bc67131xxxxxxxxxx",
"coverFilePath": "C:\\Users\\YourName\\.qoder\\skills\\wechat-publisher-skill\\cover.jpg"
}注意:Mac/Linux 系统将路径中的替换为\,如//Users/yourname/Documents/公众号教程/文章.md
invalid appidinvalid appsecretconfig.jsonmarkdownFilePath--configconfig.json# 将 <技能目录> 替换为实际路径
node "<技能目录>/index.js" --config "<技能目录>/config.json"
# Windows 示例
node "C:\Users\YourName\.qoder\skills\wechat-publisher-skill\index.js" --config "C:\Users\YourName\.qoder\skills\wechat-publisher-skill\config.json"
# Mac/Linux 示例
node "/Users/yourname/.qoder/skills/wechat-publisher-skill/index.js" --config "/Users/yourname/.qoder/skills/wechat-publisher-skill/config.json"# 相对路径在 Windows 跨盘符时可能失败
node index.js --config ./config.json
# 不要直接传递参数
node index.js --file xxx.md --app-id xxx --app-secret xxxipinvalid appsecretinvalid appid>L: 左侧对话内容
>R: 右侧对话内容
>L: 又一句左侧内容
>R: 又一句右侧内容wechat-publisher-skillindex.jsthemesjson