ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

wechat-public-cli

Publish and download WeChat Public Platform content and Baijiahao articles via a local CLI.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ai-chen2050/wechat-public-cli
Or

Wechat Public CLI Skill

Goal

Publish an Obsidian markdown article to WeChat Public Platform or Baidu Baijiahao using a local CLI.

Requirements

  • Node.js 16+
  • Config file or environment variables for credentials
  • Markdown file with frontmatter (author, digest, banner or banner_path, thumb_media_id optional)

Article Template


title: "Test" author: Blake digest: Short summary banner: "https://image.png"


Install

git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git
cd obsidian-wechat-public-platform
npm install

Or by clawdhub
claw install wechat-public-cli

Or install globally via npm:

npm install -g wechat-public-cli

If this CLI is published to npm, you can run it via npx without cloning:

npx wechat-public-cli wechat:draft --file /path/to/article.md

Config

Create a JSON file in the repo root named wechat-public.config.json:

{
	"wechat": {
		"appid": "YOUR_APP_ID",
		"secret": "YOUR_APP_SECRET",
		"accessToken": ""
	},
	"baidu": {
		"cookie": "YOUR_BJH_COOKIE",
		"token": "YOUR_BJH_TOKEN",
		"appId": "YOUR_BJH_APP_ID"
	},
	"paths": {
		"customCss": "./custom.css",
		"downloadDir": "./wechat-downloads"
	}
}

Env override:

  • WECHAT_APPID, WECHAT_SECRET, WECHAT_ACCESS_TOKEN
  • BJH_COOKIE, BJH_TOKEN, BJH_APP_ID
  • WECHAT_CUSTOM_CSS, WECHAT_PUBLIC_CONFIG
  • WECHAT_DOWNLOAD_DIR

Build

npm run build:cli

Commands

  • Create WeChat draft:
    wechat-public-cli wechat:draft --file /path/to/article.md
    # 使用自定义 CSS
    wechat-public-cli wechat:draft --file /path/to/article.md --css /path/to/tech.css
    
  • Publish WeChat (from file):
    wechat-public-cli wechat:publish --file /path/to/article.md
    # 使用自定义 CSS
    wechat-public-cli wechat:publish --file /path/to/article.md --css /path/to/business.css
    
  • Publish WeChat (from media_id):
    wechat-public-cli wechat:publish --media-id YOUR_MEDIA_ID
    
  • Send to all WeChat followers:
    wechat-public-cli wechat:sendall --file /path/to/article.md
    
  • Publish Baijiahao:
    wechat-public-cli bjh:publish --file /path/to/article.md
    # 使用自定义 CSS
    wechat-public-cli bjh:publish --file /path/to/article.md --css /path/to/custom.css
    
  • Convert markdown to HTML:
    wechat-public-cli convert --file /path/to/article.md --platform wechat
    # 使用自定义 CSS
    wechat-public-cli convert --file /path/to/article.md --platform wechat --css /path/to/style.css
    
  • Download recent N WeChat articles:
    wechat-public-cli wechat:download --count 10 --out-dir ./wechat-downloads
    
  • Get cumulative user statistics:
    # 查询最近7天(默认)
    wechat-public-cli wechat:stats:cumulate
    # 指定日期范围(最多30天)
    wechat-public-cli wechat:stats:cumulate --begin-date 2025-11-01 --end-date 2025-11-07
    
  • Get published content overview statistics:

Metadata

Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ai-chen2050-wechat-public-cli": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.