baoyu-post-to-wechat
Original:🇺🇸 English
Translated
28 scripts
Posts content to WeChat Official Account draft box via official API. Supports HTML/Markdown input, cover image upload, inline image upload, and draft saving. Use when user asks to publish article draft to WeChat.
8installs
Sourcetentacle-pro/skills
Added on
NPX Install
npx skill4agent add tentacle-pro/skills baoyu-post-to-wechatTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →baoyu-post-to-wechat (Community Edition)
Community edition posts directly to WeChat Official Account API from local machine.
Runtime
- Entry script:
scripts/wechat-api.ts - Run command:
bash
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts <file> [options]Credentials
Put credentials in shared :
.agents/skills/.envdotenv
WECHAT_APP_ID=...
WECHAT_APP_SECRET=...Resolution order:
- Process env
.agents/skills/.env
Scope
This skill only targets draft box saving (), not mass-send.
draft/addPublishing Rules
- Cover image uses permanent material API (, type=image), obtains
material/add_material.thumb_media_id - Inline images in article HTML use , obtains public
media/uploadimg.url - Save draft through with article payload.
draft/add - ,
need_open_comment=1by default.only_fans_can_comment=0
Official API Mapping
- (
draft/add):article_type=news- must be a permanent
thumb_media_id.media_id - image URLs must come from
content.media/uploadimg
- : cover and other permanent image assets.
material/add_material?type=image - : inline images for article HTML content.
media/uploadimg
Recommended Operation Order
- Normalize Obsidian image syntax (including ) to standard markdown image form.
![[...]] - Render markdown to HTML.
- Upload inline images with and replace
uploadimgwith returned URLs.<img src> - Upload cover with permanent material API and get .
thumb_media_id - Call .
draft/add
Input
- or
.md.html - If input is markdown, script converts markdown first, then uploads inline images and publishes.
Examples
bash
# Basic markdown draft publish
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts article.md
# Explicit cover and metadata
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts article.md \
--cover Assets/Cover-Images/my-topic/cover.jpg \
--title "标题" \
--author "作者" \
--summary "摘要"
# HTML input
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts article.html --cover Assets/cover.jpgNotes
- WeChat requires inline article images to come from URLs.
uploadimg - Cover and inline image APIs are different and both are required for stable draft publishing.