@packy-tang/wx-newspic
v0.4.0
Published
微信图片消息发布工具 — 将图片发布为公众号图片消息草稿
Maintainers
Readme
wx-newspic
微信公众号「图片消息」(小绿书)自动化发布工具。支持多图上传、纯文本正文、Markdown 渲染为图文消息、中转服务器代理 IP 白名单。
安装
环境: Node.js >= 20
npm install -g @packy-tang/wx-newspic验证:wx-newspic --version
快速开始
# 图片消息(小绿书)
wx-newspic publish \
--title "今日推荐" \
--content "正文内容" \
--images "./photos/*.png"
# 图文消息(Markdown 渲染)
wx-newspic publish \
--type news \
--title "标题" \
--md article.md \
--theme orangeheart配置
凭证优先级:CLI 参数 > 环境变量 > .env 文件。
# CLI 参数
wx-newspic publish --app-id "wx_xxx" --app-secret "secret_xxx"
# 环境变量
export WECHAT_APP_ID=your_app_id
export WECHAT_APP_SECRET=your_app_secret
# 持久化
wx-newspic credential set --app-id "wx_xxx" --app-secret "secret_xxx"
# 验证
wx-newspic credential check中转服务器配置(可选):
wx-newspic credential set --server "https://your-server.com" --api-key "sk-xxx"文档
| 用途 | | |------|---| | 命令完整参考 | Wiki → | | publish 发布 | 参数说明 → | | render 本地渲染 | 参数说明 → | | serve 中转服务 | 参数 + 持久化 → | | credential 凭证 | 管理命令 → | | theme 主题管理 | 自定义主题 → | | preview 分屏预览 | 功能说明 → | | 样式定制技能 | 提取→生成→验证→预览 → | | 质量门禁 | 13 项检查 → | | 中转服务器部署 | systemd/pm2 → | | 故障排查 | 常见问题 → |
项目组成
| 组件 | 目录 | 说明 |
|------|------|------|
| 文档 | docs/ | 需求、API 方案、架构设计、Skill 设计 |
| Skill | skills/wx-newspic/ | Agent Skill,封装发布链路 |
| 样式定制 | skills/style-customizer/ | 公众号文章样式定制技能 |
| CLI | cli/ | 命令行工具 |
| 参考 | reference/ | 现有 wechat-publisher Skill 与 wenyan-cli 参考 |
