Wechat Publisher logo

Wechat Publisher

Organization
NeverSight
wechat-publisher

一键发布 Markdown 到微信公众号草稿箱。基于 wenyan-cli,支持多主题、代码高亮、图片自动上传。

Overview

PublisherNeverSight
Repositorylearn-skills.dev
Skill namewechat-publisher
Stars
210
Forks
38
Bundled files
11
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 11 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by NeverSight on GitHub. Read the source before you install it.

Installation

Install the Wechat Publisher AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NeverSight/learn-skills.dev.git /tmp/learn-skills.dev
mkdir -p .claude/skills
cp -r /tmp/learn-skills.dev/data/skills-md/0731coderlee-sudo/wechat-publisher/wechat-publisher .claude/skills/wechat-publisher
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Wechat Publisher in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Wechat Publisher on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Wechat Publisher is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

wechat-publisher

一键发布 Markdown 文章到微信公众号草稿箱

基于 wenyan-cli 封装的 OpenClaw skill。

功能

  • ✅ Markdown 自动转换为微信公众号格式
  • ✅ 自动上传图片到微信图床
  • ✅ 一键推送到草稿箱
  • ✅ 多主题支持(代码高亮、Mac 风格代码块)
  • ✅ 支持本地和网络图片

快速开始

1. 安装 wenyan-cli

wenyan-cli 需要全局安装:

bash
npm install -g @wenyan-md/cli

验证安装:

bash
wenyan --help

注意: publish.sh 脚本会自动检测并安装 wenyan-cli(如果未安装)

2. 配置 API 凭证

API 凭证已保存在 /Users/leebot/.openclaw/workspace/TOOLS.md

确保环境变量已设置:

bash
export WECHAT_APP_ID=your_wechat_app_id
export WECHAT_APP_SECRET=your_wechat_app_secret

重要: 确保你的 IP 已添加到微信公众号后台的白名单!

配置方法:https://yuzhi.tech/docs/wenyan/upload

3. 准备 Markdown 文件

文件顶部必须包含完整的 frontmatter(wenyan 强制要求):

markdown
---
title: 文章标题(必填!)
cover: https://example.com/cover.jpg  # 封面图(必填!)
---

# 正文开始

你的内容...

⚠️ 关键发现(实测):

  • titlecover 都是必填字段
  • 缺少任何一个都会报错:"未能找到文章封面"
  • 虽然文档说"正文有图可省略cover",但实际测试必须提供 cover
  • 所有图片(本地/网络)都会自动上传到微信图床

推荐封面图来源:

markdown
# 方案1: 相对路径(推荐,便于分享)
cover: ./assets/default-cover.jpg

# 方案2: 绝对路径
cover: /Users/bruce/photos/cover.jpg

# 方案3: 网络图片
cover: https://your-cdn.com/image.jpg

💡 提示: 使用相对路径时,从 Markdown 文件所在目录开始计算。

4. 发布文章

方式 1: 使用 publish.sh 脚本

bash
cd /Users/leebot/.openclaw/workspace/wechat-publisher
./scripts/publish.sh /path/to/article.md

方式 2: 直接使用 wenyan-cli

bash
wenyan publish -f article.md -t lapis -h solarized-light

方式 3: 在 OpenClaw 中使用

"帮我发布这篇文章到微信公众号" + 附带 Markdown 文件路径

主题选项

wenyan-cli 支持多种主题:

内置主题:

代码高亮主题:

  • atom-one-dark / atom-one-light
  • dracula
  • github-dark / github
  • monokai
  • solarized-dark / solarized-light (推荐)
  • xcode

使用示例:

bash
# 使用 lapis 主题 + solarized-light 代码高亮
wenyan publish -f article.md -t lapis -h solarized-light

# 使用 phycat 主题 + GitHub 代码高亮
wenyan publish -f article.md -t phycat -h github

# 关闭 Mac 风格代码块
wenyan publish -f article.md -t lapis --no-mac-style

# 关闭链接转脚注
wenyan publish -f article.md -t lapis --no-footnote

自定义主题

临时使用自定义主题

bash
wenyan publish -f article.md -c /path/to/custom-theme.css

安装自定义主题(永久)

bash
# 从本地文件安装
wenyan theme --add --name my-theme --path /path/to/theme.css

# 从网络安装
wenyan theme --add --name my-theme --path https://example.com/theme.css

# 使用已安装的主题
wenyan publish -f article.md -t my-theme

# 删除主题
wenyan theme --rm my-theme

列出所有主题

bash
wenyan theme -l

工作流程

  1. 准备内容 - 用 Markdown 写作
  2. 运行脚本 - 一键发布到草稿箱
  3. 审核发布 - 到公众号后台审核并发布

Markdown 格式要求

必需的 Frontmatter

⚠️ 关键(实测结果):wenyan-cli 强制要求完整的 frontmatter!

markdown
---
title: 文章标题(必填!)
cover: 封面图片URL或路径(必填!)
---

示例 1:相对路径(推荐)

markdown
---
title: 我的技术文章
cover: ./assets/cover.jpg
---

# 正文...

示例 2:绝对路径

markdown
---
title: 我的技术文章
cover: /Users/bruce/photos/cover.jpg
---

# 正文...

示例 3:网络图片

markdown
---
title: 我的技术文章
cover: https://example.com/cover.jpg
---

# 正文...

❌ 错误示例(会报错):

markdown
# 只有 title,没有 cover
---
title: 我的文章
---

错误信息:未能找到文章封面
markdown
# 完全没有 frontmatter
# 我的文章

错误信息:未能找到文章封面

💡 重要发现:

  • 虽然 wenyan 官方文档说"正文有图片可省略cover"
  • 实际测试必须提供 cover,否则报错
  • title 和 cover 缺一不可

图片支持

  • ✅ 本地路径:![](./images/photo.jpg)
  • ✅ 绝对路径:![](/Users/bruce/photo.jpg)
  • ✅ 网络图片:![](https://example.com/photo.jpg)

所有图片会自动上传到微信图床!

代码块

markdown
```python
def hello():
    print("Hello, WeChat!")
```

会自动添加代码高亮和 Mac 风格装饰。

故障排查

1. 上传失败:IP 不在白名单

错误信息: ip not in whitelist

解决方法:

  1. 获取你的公网 IP:curl ifconfig.me
  2. 登录微信公众号后台:https://mp.weixin.qq.com/
  3. 开发 → 基本配置 → IP 白名单 → 添加你的 IP

2. wenyan-cli 未安装

错误信息: wenyan: command not found

解决方法:

bash
npm install -g @wenyan-md/cli

3. 环境变量未设置

错误信息: WECHAT_APP_ID is required

解决方法:

bash
export WECHAT_APP_ID=your_wechat_app_id
export WECHAT_APP_SECRET=your_wechat_app_secret

或在 ~/.zshrc / ~/.bashrc 中永久添加。

4. Frontmatter 缺失

错误信息: title is required in frontmatter

解决方法: 在 Markdown 文件顶部添加:

markdown
---
title: 你的文章标题
---

参考资料

更新日志

2026-02-05 - v1.0.0

  • ✅ 初始版本
  • ✅ 基于 wenyan-cli 封装
  • ✅ 支持一键发布到草稿箱
  • ✅ 多主题支持
  • ✅ 自动图片上传

License

Apache License 2.0 (继承自 wenyan-cli)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Wechat Publisher AI skill do?

一键发布 Markdown 到微信公众号草稿箱。基于 wenyan-cli,支持多主题、代码高亮、图片自动上传。

Why use Wechat Publisher on TypingMind?

Because you install it once and use it with any model. Wechat Publisher is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Wechat Publisher in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NeverSight/learn-skills.dev/tree/main/data/skills-md/0731coderlee-sudo/wechat-publisher/wechat-publisher. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Wechat Publisher?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Wechat Publisher?

As many as you like. As long as a model supports skills, you can use Wechat Publisher with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Wechat Publisher AI skill free?

It is published on GitHub by NeverSight. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇