baoyu-post-to-wechat

Publishes articles and image-text posts to WeChat Official Accounts via API or Chrome CDP.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chhpt/skills --skill baoyu-post-to-wechat-chhpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-post-to-wechat
Source: https://github.com/chhpt/skills/tree/main/skills/baoyu-post-to-wechat
Command: npx skills add https://github.com/chhpt/skills --skill baoyu-post-to-wechat-chhpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Publishing content to a WeChat Official Account normally requires manual copy-pasting into the web editor, re-uploading images one by one, and reformatting markdown. This Skill automates the entire publishing pipeline from markdown, HTML, or plain text directly to a WeChat draft. ## Core Features & Use Cases - Article Publishing (文章): Converts markdown to themed HTML (default, grace, simple) and publishes via the WeChat draft/add API or browser automation, with automatic title, summary, author, and cover image resolution. - Image-Text Posting (贴图/图文): Uploads up to 9 images with auto-compressed titles and content through Chrome CDP browser automation. - Preferences & Credentials Management: Loads defaults from EXTEND.md and API credentials from .baoyu-skills/.env at project or user level, with guided first-time setup. - Use Case: A blogger writes a post in markdown and says "发布公众号" — the Skill converts it to themed HTML, uploads inline images, sets comment preferences, and saves it as a draft on mp.weixin.qq.com. ## Quick Start Ask the assistant to publish your markdown article to your WeChat Official Account, for example: "Post article.md to my WeChat Official Account using the grace theme."

Frequently Asked Questions about baoyu-post-to-wechat

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish a markdown article to WeChat Official Account?

Run the wechat-api.ts script with your markdown file, or let the Skill convert it via a markdown-to-html skill first. It extracts title, summary, and cover from frontmatter, uploads inline images, and saves the article as a draft via the WeChat draft/add API.

What is the difference between WeChat API and browser publishing methods?

The API method is faster and supports comment controls and cover defaults but requires WECHAT_APP_ID and WECHAT_APP_SECRET credentials. The browser method uses Chrome CDP automation with a logged-in session, requiring no API credentials but running slower.

How many images can a WeChat image-text post contain?

Image-text posts (贴图, formerly 图文) support up to 9 images per WeChat's limit. Titles are capped at 20 characters and content at 1000 characters, with automatic compression when exceeded.

Does WeChat publishing work on Linux and Windows?

Yes, the scripts support macOS, Linux, and Windows. Clipboard operations use Swift/AppKit on macOS, wl-copy or xclip on Linux, and PowerShell on Windows; paste keystrokes use osascript, xdotool/ydotool, or SendKeys respectively.

Why does WeChat API publishing fail with access token errors?

Access token errors occur when WECHAT_APP_ID or WECHAT_APP_SECRET are missing, invalid, or expired. Store credentials in .baoyu-skills/.env at project or user level, or set them as environment variables, then retry.

What are the limitations of the browser automation method?

The browser method requires Chrome, a one-time QR code login, and accessibility/clipboard permissions on macOS. It does not support comment settings or default cover fallback, and it runs slower than the API method.