1.8 KiB
1.8 KiB
| name | description |
|---|---|
| baoyu-post-to-wechat | Post content to WeChat Official Account (微信公众号). Supports both article posting (文章) and image-text posting (图文). |
Post to WeChat Official Account (微信公众号)
Post content to WeChat Official Account using Chrome CDP automation.
Quick Usage
Image-Text (图文) - Multiple images with title/content
# From markdown file and image directory
npx -y bun ./scripts/wechat-browser.ts --markdown article.md --images ./images/
# With explicit parameters
npx -y bun ./scripts/wechat-browser.ts --title "标题" --content "内容" --image img1.png --image img2.png --submit
Article (文章) - Full markdown with formatting
# Post markdown article
npx -y bun ./scripts/wechat-article.ts --markdown article.md --theme grace
References
- Image-Text Posting: See
references/image-text-posting.mdfor detailed image-text posting guide - Article Posting: See
references/article-posting.mdfor detailed article posting guide
Prerequisites
- Google Chrome installed
bunruntime (vianpx -y bun)- First run: log in to WeChat Official Account in the opened browser window
Features
| Feature | Image-Text | Article |
|---|---|---|
| Multiple images | ✓ (up to 9) | ✓ (inline) |
| Markdown support | Title/content extraction | Full formatting |
| Auto title compression | ✓ (to 20 chars) | ✗ |
| Content compression | ✓ (to 1000 chars) | ✗ |
| Themes | ✗ | ✓ (default, grace, simple) |
Troubleshooting
- Not logged in: First run opens browser - scan QR code to log in, session is preserved
- Chrome not found: Set
WECHAT_BROWSER_CHROME_PATHenvironment variable - Paste fails: Check system clipboard permissions