skill/SKILL.md
Publish and download WeChat Public Platform content and Baijiahao articles via a local CLI.
npx skillsauth add ai-chen2050/obsidian-wechat-public-platform wechat-public-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Publish an Obsidian markdown article to WeChat Public Platform or Baidu Baijiahao using a local CLI.
title: "Test" author: Blake digest: Short summary banner: "https://image.png"
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
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_DIRnpm run build:cli
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
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
wechat-public-cli wechat:publish --media-id YOUR_MEDIA_ID
wechat-public-cli wechat:sendall --file /path/to/article.md
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
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
wechat-public-cli wechat:download --count 10 --out-dir ./wechat-downloads
# 查询最近7天(默认)
wechat-public-cli wechat:stats:cumulate
# 指定日期范围(最多30天)
wechat-public-cli wechat:stats:cumulate --begin-date 2025-11-01 --end-date 2025-11-07
# 查询最近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 参数指定自定义样式文件:
# 使用技术类文章样式
wechat-public-cli wechat:draft --file tech-article.md --css ./styles/tech.css
# 使用营销类文章样式
wechat-public-cli wechat:publish --file marketing.md --css ./styles/marketing.css
# 使用教程类文章样式
wechat-public-cli bjh:publish --file tutorial.md --css ./styles/tutorial.css
你可以通过定义和修改 CSS 文件,来调整发布到微信公众号的文章样式。支持为不同类型的文章使用不同的样式文件。
--css (最高优先级)wechat-public.config.json 中的 paths.customCsscustom.css在项目根目录创建 custom.css,不传任何参数时自动使用:
wechat-public-cli wechat:publish --file article.md
创建多个 CSS 文件,通过 --css 参数指定:
# 技术类文章使用 tech.css
wechat-public-cli wechat:publish --file tech-article.md --css ./styles/tech.css
# 商业类文章使用 business.css
wechat-public-cli wechat:publish --file business-article.md --css ./styles/business.css
# 教程类文章使用 tutorial.css
wechat-public-cli wechat:publish --file tutorial.md --css ./styles/tutorial.css
在 wechat-public.config.json 的 paths.customCss 字段指定默认样式文件路径:
{
"paths": {
"customCss": "./styles/default.css"
}
}
这样不传 --css 参数时,会使用配置文件中指定的样式。
/* tech.css - 技术文章样式 */
.wechat-title {
font-size: 2em;
color: #2c3e50;
font-family: "Monaco", "Consolas", monospace;
}
.wechat-banner {
border-radius: 8px;
}
code {
background-color: #f4f4f4;
padding: 2px 4px;
}
/* business.css - 商业文章样式 */
.wechat-title {
font-size: 2.2em;
color: #c7254e;
font-family: "Arial", "Helvetica", sans-serif;
}
AI 也可通过自动生成或修改 CSS 文件,实现对公众号内容格式的智能优化。
thumb_media_id or banner/banner_path in frontmatter.banner or banner_path in frontmatter.wechat:download saves recent articles in update_time order and writes all news_item entries.wechat:stats:cumulate / wechat:stats:bizsummary must be called server-side; the date range can be at most 30 days. Results are printed as JSON to stdout.tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.