wechat-public-cli
Publish and download WeChat Public Platform content and Baijiahao articles via a local CLI.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ai-chen2050/wechat-public-cliWechat 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_TOKENBJH_COOKIE,BJH_TOKEN,BJH_APP_IDWECHAT_CUSTOM_CSS,WECHAT_PUBLIC_CONFIGWECHAT_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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ai-chen2050-wechat-public-cli": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
square-post
Post content to Binance Square (Binance social platform for sharing trading insights). Auto-run on messages like 'post to square', 'square post'. Supports pure text posts.
gluex-interaction
Operate the GlueX Solana protocol (register profiles, listen to bounties, claim tasks, approve rewards, map social graph connections) directly from the CLI.
moltrade
Operate the Moltrade trading bot (config, backtest, test-mode runs, Nostr signal broadcast, exchange adapters, strategy integration) in OpenClaw.