Install
openclaw skills install wechat-mp-draft-publisherPublish 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.
openclaw skills install wechat-mp-draft-publisherPublish draft articles by calling the bundled wrapper script, which enforces this fixed sequence:
getAuthuploadArticleImageuploadCoverImageaddDraft--bin /absolute/path/to/mp-weixin-skillMP_WECHAT_CLI_BINMP_WECHAT_RELEASE_URL=https://github.com/<owner>/<repo>/releases/download/<tag>/<asset> (direct asset URL, supports zip or binary)MP_WECHAT_GITHUB_REPO=owner/repoMP_WECHAT_RELEASE_TAG=latest (default latest)MP_WECHAT_ASSET_NAME=custom-asset-namegetAuth:
~/.weixin_credentialsappid=YOUR_APP_IDsecret=YOUR_APP_SECRET--content-file), usually HTML--article-image)--cover-image)Use the wrapper script:
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 "Article Title" \
--author "Author Name" \
--digest "Optional digest"
GitHub Release mode (auto-download executable):
export MP_WECHAT_GITHUB_REPO="owner/repo"
export MP_WECHAT_RELEASE_TAG="latest"
bash scripts/publish_draft.sh \
--cover-image /absolute/path/to/cover-image.png \
--content-file /absolute/path/to/content.html \
--title "Article Title"
Direct URL mode:
export MP_WECHAT_RELEASE_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 "Article Title"
If uploadCoverImage response does not include usable media_id, pass it explicitly:
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 "Article Title" \
--thumb-media-id "YOUR_MEDIA_ID"
Script prints one JSON object on stdout:
access_token: token returned by getAutharticle_image_url: URL returned by uploadArticleImagecover_upload: raw JSON object returned by uploadCoverImagethumb_media_id_used: value passed to addDraftdraft: raw JSON object returned by addDraftOn failure, script prints JSON error to stderr and exits non-zero.
references/cli-contract.md