Publish WeChat Official Account draft articles through a packaged CLI executable that wraps WeChat API calls. Use when the user wants to publish or create a draft from local article content and images, especially when the required flow is getAuth -> uploadArticleImage -> uploadCoverImage -> addDraft.
通过调用封装的包装脚本发布草稿文章,该脚本强制执行以下固定顺序:
使用包装脚本:
bash
bash scripts/publish_draft.sh \
--article-image /absolute/path/to/article-image.png \
--cover-image /absolute/path/to/cover-image.png \
--content-file /absolute/path/to/content.html \
--title 文章标题 \
--author 作者名称 \
--digest 可选摘要
GitHub Release 模式(自动下载可执行文件):
bash
export MPWECHATGITHUB_REPO=owner/repo
export MPWECHATRELEASE_TAG=latest
bash scripts/publish_draft.sh \
--cover-image /absolute/path/to/cover-image.png \
--content-file /absolute/path/to/content.html \
--title 文章标题
直接 URL 模式:
bash
export MPWECHATRELEASE_URL=https://github.com/Mesus/weixin-mp-skill/releases/download/v0.0.1/mp-weixin-skill.zip
bash scripts/publish_draft.sh \
--cover-image /absolute/path/to/cover-image.png \
--content-file /absolute/path/to/content.html \
--title 文章标题
如果 uploadCoverImage 响应不包含可用的 media_id,请显式传递:
bash
bash scripts/publish_draft.sh \
--bin /absolute/path/to/mp-weixin-skill \
--article-image /absolute/path/to/article-image.png \
--cover-image /absolute/path/to/cover-image.png \
--content-file /absolute/path/to/content.html \
--title 文章标题 \
--thumb-media-id YOURMEDIAID
脚本在标准输出上打印一个 JSON 对象:
失败时,脚本将 JSON 错误打印到标准错误输出并以非零状态退出。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 wechat-mp-draft-publisher-1775943291 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 wechat-mp-draft-publisher-1775943291 技能
skillhub install wechat-mp-draft-publisher-1775943291
文件大小: 6.86 KB | 发布时间: 2026-4-12 11:56