{"skill":{"slug":"wxgzh","displayName":"wxgzh","summary":"微信公众号文章发布工具。使用 wxgzh CLI 将 Markdown 文章发布到公众号草稿箱。触发场景：用户要发公众号文章、配置公众号 AppID/AppSecret、生成封面图、Markdown 转 HTML。","description":"---\nname: wxgzh\ndescription: 微信公众号文章发布工具。使用 wxgzh CLI 将 Markdown 文章发布到公众号草稿箱。触发场景：用户要发公众号文章、配置公众号 AppID/AppSecret、生成封面图、Markdown 转 HTML。\n---\n\n# wxgzh\n\n封装 `@lyhue1991/wxgzh` 命令行工具，用于微信公众号文章发布。\n\n## 核心能力\n\n1. **一键发布文章** - Markdown → 公众号草稿箱\n2. **配置管理** - AppID/AppSecret 配置\n3. **封面生成** - 自动生成或自定义封面图\n4. **格式转换** - Markdown → 公众号 HTML\n\n## 工作流程\n\n### 📝 发布文章到公众号\n\n当用户表达发布文章意图时，按以下流程执行：\n\n```\n1. 检查安装 → 2. 检查配置 → 3. 发布文章\n```\n\n**Step 1: 检查是否安装 wxgzh**\n```bash\ncommand -v wxgzh\n```\n如果未安装，执行：\n```bash\nnpm install -g @lyhue1991/wxgzh\n```\n\n**Step 2: 检查配置**\n```bash\nwxgzh config --list\n```\n如果未配置，询问用户提供：\n- `AppID`（公众号开发接口管理中的 AppID）\n- `AppSecret`（公众号开发接口管理中的 AppSecret）\n\n然后执行：\n```bash\nwxgzh config --appid 你的AppID --appsecret 你的AppSecret\n```\n\n> ⚠️ 提醒用户：需要把本机公网 IP 加入公众号后台的 IP 白名单\n> 查看公网 IP：访问 https://ip.sb/\n\n**Step 3: 发布文章**\n```bash\nwxgzh article.md --author \"文章作者姓名\"\n```\n\n支持参数：\n- `--author <name>` - 作者名\n- `--theme <theme>` - 主题样式（default/blue/green/red/yellow/brown/black/orange）\n- `--cover <path>` - 指定封面图\n- `--digest <text>` - 文章摘要\n- `--enable-comment` - 开启评论\n\n### ⚙️ 配置公众号\n\n当用户只需配置 AppID/AppSecret 时：\n\n```bash\nwxgzh config --appid 你的AppID --appsecret 你的AppSecret\n```\n\n### 🖼️ 生成封面图\n\n当用户需要生成封面时：\n\n```bash\nwxgzh cover --title \"我的文章\" --to .wxgzh/cover.jpg\n```\n\n生成后立即预览结果（macOS）：\n\n```bash\nwxgzh cover --title \"我的文章\" --to .wxgzh/cover.jpg && open .wxgzh/cover.jpg\n```\n\n查看内置背景：\n```bash\nwxgzh cover --list\n```\n\n### 📄 Markdown 转 HTML\n\n当用户只需转换格式时：\n\n```bash\nwxgzh md2html --from article.md --to .wxgzh/article.html\n```\n\n## 注意事项\n\n1. **IP 白名单** - 调用微信接口前，必须把本机公网 IP 加入公众号后台白名单\n2. **配置文件位置** - `~/.config/wxgzh/wxgzh.json`\n3. **中间产物** - 默认输出到文章同级目录的 `.wxgzh/` 文件夹\n\n## 快速参考\n\n```bash\n# 查看帮助\nwxgzh --help\n\n# 查看配置\nwxgzh config --list\n\n# 查看主题\nwxgzh config --list-themes\n\n# 一键发布\nwxgzh article.md --author 你的名字 --theme blue\n\n# 分步执行\nwxgzh md2html --from article.md --to .wxgzh/article.html\nwxgzh fix .wxgzh/article.html\nwxgzh cover --title \"标题\" --to .wxgzh/cover.jpg\nwxgzh publish --article .wxgzh/article.html --cover .wxgzh/cover.jpg\n```\n","tags":{"latest":"0.1.4"},"stats":{"comments":0,"downloads":727,"installsAllTime":1,"installsCurrent":1,"stars":1,"versions":1},"createdAt":1773147165636,"updatedAt":1778997377001},"latestVersion":{"version":"0.1.4","createdAt":1773147165636,"changelog":"wxgzh 0.1.4\n\n- 新增和完善 SKILL.md，详细描述核心功能、工作流程、用法和注意事项。\n- 明确支持一键文章发布、公众号配置、封面图生成、Markdown 转 HTML 等功能。\n- 提供命令行使用范例及参数说明，便于用户快速参考和操作。","license":"MIT-0"},"metadata":null,"owner":{"handle":"lyhue1991","userId":"s174rgerkkbwhvn3qhh8574t75855y77","displayName":"一个有毅力的吃货","image":"https://avatars.githubusercontent.com/u/30676974?v=4"},"moderation":null}