微信公众号发布工具 v1.0
name: wechat-mp-publish
by brucesongs · published 2026-03-22
$ claw add gh:brucesongs/brucesongs-wechat-mp-publish-skill---
name: wechat-mp-publish
description: 微信公众号文章发布工具 v1.0。基于官方 API,支持智能配图、模板渲染、草稿/发布双模式。当用户说"发公众号"、"发布微信公众号"时使用此技能。
---
# 微信公众号发布工具 v1.0
快速开始
1. 安装依赖
cd ~/.openclaw/workspace/skills/wechat-mp-publish
pip install -r requirements.txt2. 配置公众号凭证
cp config.example.yaml config.yaml
# 编辑 config.yaml 填入 AppID 和 AppSecret3. 运行测试
python publish.py --test功能特性
✅ v1.0 已实现
📋 使用命令
# 测试模式(自动发布 3 篇测试文章到草稿箱)
python publish.py --test
# 发布到草稿箱
python publish.py --draft "文章标题" "文章内容"
# 直接发布
python publish.py --publish "文章标题" "文章内容"
# 指定模板
python publish.py --draft "标题" "内容" --template business🎨 模板样式
| 模板 | 风格 | 适用场景 |
|------|------|----------|
| `simple` | 简约 | 日常文章、技术文档 |
| `business` | 商务 | 正式公告、企业宣传 |
| `creative` | 创意 | 故事、随笔、创意内容 |
配置说明
config.yaml
wechat:
appid: "你的 AppID"
appsecret: "你的 AppSecret"
name: "公众号名称"
image:
provider: "dall-e-3" # 或关闭 AI 绘图
api_key: "${DALL_E_API_KEY}" # 支持环境变量环境变量
export DALL_E_API_KEY="sk-..." # DALL-E 3 API 密钥API 说明
核心类
**WeChatAPI** - 微信 API 封装
**ImageGenerator** - 图片生成
测试任务
验收标准
测试内容
主题:**"我的诞生记"**
故障排除
问题 1: invalid appid
**原因**: AppID 配置错误
**解决**: 检查 config.yaml 中的 appid 是否正确
问题 2: invalid appsecret
**原因**: AppSecret 配置错误
**解决**: 检查 appsecret,注意不要有多余空格
问题 3: 图片上传失败
**原因**: 图片格式或大小不符合要求
**解决**: 确保图片为 JPG/PNG,大小<2MB
问题 4: AI 绘图失败
**原因**: DALL-E API 密钥未配置
**解决**: 设置 DALL_E_API_KEY 环境变量或使用占位图
版本历史
v1.0.0 (2026-03-09)
相关文档
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...