baoyu-post-to-wechat
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:
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts <file> [options]
Credentials
Put credentials in shared .agents/skills/.env:
WECHAT_APP_ID=...
WECHAT_APP_SECRET=...
Resolution order:
- Process env
.agents/skills/.env
Scope
This skill only targets draft box saving (draft/add), not mass-send.
Publishing Rules
- Cover image uses permanent material API (
material/add_material, type=image), obtainsthumb_media_id. - Inline images in article HTML use
media/uploadimg, obtains publicurl. - Save draft through
draft/addwith article payload. need_open_comment=1,only_fans_can_comment=0by default.
Official API Mapping
draft/add(article_type=news):thumb_media_idmust be a permanentmedia_id.contentimage URLs must come frommedia/uploadimg.
material/add_material?type=image: cover and other permanent image assets.media/uploadimg: inline images for article HTML content.
Recommended Operation Order
- Normalize Obsidian image syntax (including
![[...]]) to standard markdown image form. - Render markdown to HTML.
- Upload inline images with
uploadimgand replace<img src>with returned URLs. - Upload cover with permanent material API and get
thumb_media_id. - Call
draft/add.
Input
.mdor.html- If input is markdown, script converts markdown first, then uploads inline images and publishes.
Examples
# 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.jpg
Notes
- WeChat requires inline article images to come from
uploadimgURLs. - Cover and inline image APIs are different and both are required for stable draft publishing.
More from tentacle-pro/skills
baoyu-markdown-to-html
Converts Markdown to styled HTML with WeChat-compatible themes. Supports code highlighting, math, PlantUML, footnotes, alerts, infographics, and optional bottom citations for external links. Use when user asks for "markdown to html", "convert md to html", "md转html", "微信外链转底部引用", or needs styled HTML output from markdown.
22baoyu-article-illustrator
Analyzes article structure, identifies positions requiring visual aids, generates illustrations with Type × Style two-dimension approach. Use when user asks to "illustrate article", "add images", "generate images for article", or "为文章配图".
20baoyu-image-gen
AI image generation with OpenAI, Google, DashScope and Replicate APIs. Supports text-to-image, reference images, aspect ratios. Sequential by default; parallel generation available on request. Use when user asks to generate, create, or draw images.
19baoyu-cover-image
Generates article cover images with 5 dimensions (type, palette, rendering, text, mood) combining 9 color palettes and 6 rendering styles. Supports cinematic (2.35:1), widescreen (16:9), and square (1:1) aspects. Use when user asks to "generate cover image", "create article cover", or "make cover".
19redbookskills
|
18baoyu-compress-image
Compresses images to JPEG/WebP/PNG using an automated multi-platform CLI (sips, cwebp, sharp). Washed for Obsidian Creator Vault: defaults to JPEG at 65 quality (for <1MB output), and auto-archives original files.
18