baoyu-post-to-wechat

Posts content to WeChat Official Account (微信公众号) via API or Chrome CDP. Supports article posting (文章) with HTML, markdown, or plain text input, and image-text posting (图文) with multiple images. Use when user mentions "发布公众号", "post to wechat", "微信公众号", or "图文/文章".

Author

Install

Hot:53

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=jimliu-skills-baoyu-post-to-wechat&locale=en&source=copy

WeChat Official Account Auto-Publishing Tool - baoyu-post-to-wechat

Skill Overview

baoyu-post-to-wechat is a Claude skill that automatically publishes content to WeChat Official Accounts. It supports publishing articles and multi-image posts using either an API or a Chrome browser automation workflow. It is compatible with HTML, Markdown, and plain text input.

Use Cases

1. Daily Publishing for Content Creators

When you need to regularly publish Markdown notes or blog posts to your Official Account, you can simply provide a Markdown file. The skill will automatically convert it into a themed HTML article and publish it—no manual formatting required.

2. Automated Content Operations

For operations scenarios that require bulk management of drafts or scheduled publishing, you can use the API method to quickly push content to the Official Account draft box, where it can later be managed and published on the WeChat Official Platform.

3. Short-Form Multi-Image Posts

Suitable for publishing short content containing multiple images (up to 9 images). Using Chrome browser automation, it performs the edit and publish steps for you, helping keep your Official Account updated at its usual cadence.

Core Features

Article Publishing (supports both API and browser methods)

  • Multiple input formats: Supports HTML, Markdown, and plain text. Markdown is automatically converted into themed Official Account article HTML.

  • Theme template selection: Provides three article themes—classic (default), elegant (grace), and simple (simple). It automatically handles formatting.

  • Automatic metadata generation: Extracts title, summary, and author information automatically, supporting reading from frontmatter or a configuration file.

  • Comment controls: In the API mode, you can configure whether comments are enabled and whether only followers can comment.
  • Multi-Image Publishing (browser method)

  • Multi-image support: Publish up to 9 images at once, with automatic compression and optimization.

  • Flexible input: Supports direct publishing with title + content, or reading from a Markdown file.

  • Chrome automation: Uses Chrome CDP to control the browser and reuses the existing login session.
  • Configuration and Extensions

  • EXTEND.md configuration: Supports setting the default theme, default publishing method, default author, comment switch, etc.

  • Credential management: API credentials can be stored in project-level or user-level .env files; they are read automatically according to priority.

  • Skill integration: Works with the markdown-to-html skill to implement a complete Markdown-to-Official-Account-article conversion flow.
  • Frequently Asked Questions

    How do I obtain the WeChat Official Account API credentials?

    Log in to WeChat Official Platform, go to Develop → Basic Configuration, and get your AppID and AppSecret. Save the credentials to a .baoyu-skills/.env file:

    WECHAT_APP_ID=YourAppID
    WECHAT_APP_SECRET=YourAppSecret

    What’s the difference between API publishing and browser publishing?

    API publishing: Fast, suitable for batch publishing and automation. Requires API credentials. Supports advanced features like draft management and comment control.

    Browser publishing: Slower, does not require API credentials. The first run requires QR-code login. Suitable for simple scenarios where you don’t want to configure API.

    Does WeChat Official Account support Markdown?

    The WeChat Official Platform itself does not support publishing Markdown directly. This skill uses the markdown-to-html skill to convert Markdown into themed HTML, then publishes it. It also supports automatically extracting the title, summary, author, and inline images.

    How do I configure the comment switch for an article?

    When using the API publishing method, set it in the EXTEND.md configuration file:

    need_open_comment: 1      # Whether comments are enabled (1/0)
    only_fans_can_comment: 0  # Whether only followers can comment (1/0)

    Or specify it in CLI arguments. Priority order: CLI arguments > Frontmatter > EXTEND.md.

    Where is the article cover image obtained during publishing?

    The cover image is searched in the following priority order:
    CLI --cover parameter > Frontmatter (featureImage/coverImage/cover/image) > Article directory imgs/cover.png > The first inline image in the content.
    If none are found, you must provide the cover image manually.

      WeChat Official Account Auto-Publish - Article Image/Text Publishing Tool in Both API and Browser Modes - Open Skills