ai-chen2050/obsidian-wechat-public-platform/skill
Claude Code and agent skill by ai-chen2050/obsidian-wechat-public-platform
- community
Checking that the SKILL.md file is still in the repository.
Publish and download WeChat Public Platform content and Baijiahao articles via a local CLI.
Install
npx vskill@latest install ai-chen2050/obsidian-wechat-public-platform/skillSKILL.md
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
Or install globally via npm:
If this CLI is published to npm, you can run it via npx without cloning:
Config
Create a JSON file in the repo root named wechat-public.config.json:
Env override:
WECHAT_APPID,WECHAT_SECRET,WECHAT_ACCESS_TOKENBJH_COOKIE,BJH_TOKEN,BJH_APP_IDWECHAT_CUSTOM_CSS,WECHAT_PUBLIC_CONFIGWECHAT_DOWNLOAD_DIR
Build
Commands
- Create WeChat draft:
``bash 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):
``bash 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):
``bash wechat-public-cli wechat:publish --media-id YOUR_MEDIA_ID ``
- Send to all WeChat followers:
``bash wechat-public-cli wechat:sendall --file /path/to/article.md ``
- Publish Baijiahao:
``bash 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:
``bash 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:
``bash wechat-public-cli wechat:download --count 10 --out-dir ./wechat-downloads ``
- Get cumulative user statistics:
``bash # 查询最近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:
``bash # 查询最近7天(默认) wechat-public-cli wechat:stats:bizsummary # 指定日期范围(最多30天) wechat-public-cli wechat:stats:bizsummary --begin-date 2025-11-01 --end-date 2025-11-07 ``
使用自定义 CSS 样式
所有发布命令都支持通过 --css 参数指定自定义样式文件:
自定义公众号格式
你可以通过定义和修改 CSS 文件,来调整发布到微信公众号的文章样式。支持为不同类型的文章使用不同的样式文件。
CSS 文件加载优先级
- 命令行参数
--css(最高优先级) - 配置文件
wechat-public.config.json中的paths.customCss - 默认文件 当前目录下的
custom.css - 空样式 如果以上都不存在,则不应用自定义样式
使用场景示例
1. 使用默认样式
在项目根目录创建 custom.css,不传任何参数时自动使用:
2. 为不同类型文章使用不同样式
创建多个 CSS 文件,通过 --css 参数指定:
3. 在配置文件中指定默认样式
在 wechat-public.config.json 的 paths.customCss 字段指定默认样式文件路径:
这样不传 --css 参数时,会使用配置文件中指定的样式。
CSS 示例
AI 也可通过自动生成或修改 CSS 文件,实现对公众号内容格式的智能优化。
Notes
- WeChat draft requires
thumb_media_idorbanner/banner_pathin frontmatter. - Baijiahao publish requires
bannerorbanner_pathin frontmatter. - The CLI uploads inline images to the target platform automatically.
wechat:downloadsaves recent articles in update_time order and writes allnews_itementries.wechat:stats:cumulate/wechat:stats:bizsummarymust be called server-side; the date range can be at most 30 days. Results are printed as JSON to stdout.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskill/skill.md
Popularity
- Repository stars
- 134
- Repository forks
- 22
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ai-chen2050/obsidian-wechat-public-platform/skill)