返回顶部
w

wechat-mp-draft-publisher微信公众号草稿发布器

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.0.1
安全检测
已通过
89
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

wechat-mp-draft-publisher

微信公众号草稿发布器

通过调用封装的包装脚本发布草稿文章,该脚本强制执行以下固定顺序:

  1. 1. getAuth
  2. uploadArticleImage
  3. uploadCoverImage
  4. addDraft

要求

  • - 通过以下方式之一提供可执行文件:
- 本地二进制路径: - CLI 标志 --bin /absolute/path/to/mp-weixin-skill - 环境变量 MPWECHATCLI_BIN - GitHub Release 自动下载: - 环境变量 MPWECHATRELEASE_URL=https://github.com///releases/download//(直接资源 URL,支持 zip 或二进制文件) - 或: - 环境变量 MPWECHATGITHUB_REPO=owner/repo - 可选环境变量 MPWECHATRELEASE_TAG=latest(默认为 latest) - 可选环境变量 MPWECHATASSET_NAME=custom-asset-name
  • - 确保存在用于 getAuth 的本地凭据文件:
- ~/.weixin_credentials - 格式: - appid=YOURAPPID - secret=YOURAPPSECRET
  • - 运行前准备以下文件:
- 文章内容文件(--content-file),通常为 HTML 格式 - 内联文章图片(--article-image) - 封面图片(--cover-image)

运行

使用包装脚本:

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 对象:

  • - accesstoken:getAuth 返回的令牌
  • articleimageurl:uploadArticleImage 返回的 URL
  • coverupload:uploadCoverImage 返回的原始 JSON 对象
  • thumbmediaid_used:传递给 addDraft 的值
  • draft:addDraft 返回的原始 JSON 对象

失败时,脚本将 JSON 错误打印到标准错误输出并以非零状态退出。

资源

  • - CLI 包装器实现细节:references/cli-contract.md

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 wechat-mp-draft-publisher-1775943291 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 wechat-mp-draft-publisher-1775943291 技能

通过命令行安装

skillhub install wechat-mp-draft-publisher-1775943291

下载

⬇ 下载 wechat-mp-draft-publisher v0.0.1(免费)

文件大小: 6.86 KB | 发布时间: 2026-4-12 11:56

v0.0.1 最新 2026-4-12 11:56
Initial release of WeChat MP Draft Publisher.

- Publish WeChat Official Account draft articles via a packaged CLI that enforces the sequence: getAuth → uploadArticleImage → uploadCoverImage → addDraft.
- Supports specifying the executable by local path, environment variable, or automatic download from GitHub Releases.
- Requires local credentials and prepared article content/image files.
- Outputs publishing results in structured JSON; prints errors to stderr.
- Provides example usage for various integration options.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部