aws-wechat-article-publish
公众号发布|公众号草稿箱|公众号群发|图文推送|微信 API|wechat automation|WeChat API automation|auto publish|scheduled publish — 公众号 API 发布工具,图文入草稿箱或直接群发,支持封面素材上传、发布前检查与 draft/published 模式切换。面向公众号运营、自动化内容团队、开发者。触发词:「发布」「提交」「群发」「推送」「发出去」「上传到公众号」「发到公众号」「可以发了吗」「发布前检查」。需要多环节串联(写+审+排+配图+发)请走 aws-wechat-article-main。 Skill: aws-wechat-article-publish Owner: aiworkskills Summary: 公众号发布|公众号草稿箱|公众号群发|图文推送|微信 API|wechat automation|WeChat API automation|auto publish|scheduled publish — 公众号 API 发布工具,图文入草稿箱或直接群发,支持封面素材上传、发布前检查与 draft/published 模式切换。面向公众号运营、自动化内容团队、开发者。触发词:「发布」「提交」「群发」「推送」「发出去」「上传到公众号」「发到公众号」「可以发了吗」「发布前检查」。需要多环节串联(写+审+排+配图+发)请走 aws-wechat-article-main。 Tags: api:1.0.17, automation:1.0.17, chinese:1.0.17, claude-code:1.0.
Rank
62
Safety
84
Downloads
1.4k
Updated
Oct 10, 2026
Version
1.0.24
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.4K downloadsadoption · observed Oct 10, 2026
- Latest release
- 1.0.24release · observed Sep 7, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s170f08a9xbhfkfp1vjv33y1ph842r9a:aws-wechat-article-publish- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-aiworkskills-aws-wechat-article-publish/snapshot"
Documentation
CLAWHUB
147,969 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: aws-wechat-article-publish
description: 公众号发布|公众号草稿箱|公众号群发|图文推送|微信 API|wechat automation|WeChat API automation|auto publish|scheduled publish — 公众号 API 发布工具,图文入草稿箱或直接群发,支持封面素材上传、发布前检查与 draft/published 模式切换。面向公众号运营、自动化内容团队、开发者。触发词:「发布」「提交」「群发」「推送」「发出去」「上传到公众号」「发到公众号」「可以发了吗」「发布前检查」。需要多环节串联(写+审+排+配图+发)请走 aws-wechat-article-main。
homepage: https://aiworkskills.cn
url: https://github.com/aiworkskills/wechat-article-skills
metadata:
openclaw:
requires:
env:
- WECHAT_1_APPID
- WECHAT_1_APPSECRET
bins:
- python3
primaryEnv: aws.env
---
# 发布
**公众号 API 直连发布** —— 图文入草稿箱或直接群发,素材上传、发布前检查一站式完成。
> **套件说明** · 本 skill 属 `aws-wechat-article-*` 一条龙套件(共 9 个 slug,入口 `aws-wechat-article-main`)。跨 skill 的相对引用依赖同一 `skills/` 目录,建议一并 `clawhub install` 全套。源码:<https://github.com/aiworkskills/wechat-article-skills>
## 能力披露(Capabilities)
本 skill 调 `publish.py` **直连微信公众号官方 API** 发布图文。**会把本篇 `article.html` 与 `imgs/*` 文件作为 POST body 上传到微信服务器。** 具体行为:
- **凭证读取**:`aws.env` 的 `WECHAT_{N}_APPID` / `WECHAT_{N}_APPSECRET`(多槽位支持 N≥1)
- **凭证外发**:`APPID` / `APPSECRET` 以 query string 形式发给 `api.weixin.qq.com/cgi-bin/token` 换 `access_token`;后续请求带 `access_token` query string。微信返回的 `access_token` 在进程内存短期缓存,**不落盘**
- **内容外发**:本篇封面、正文插图以 multipart upload 发给 `material/add_material`;`article.html` 正文与标题/摘要以 JSON POST 发给 `draft/add`、`freepublish/submit`
- **网络目标**:默认 `api.weixin.qq.com`;用户可在 `WECHAT_{N}_API_BASE` / `config.yaml.wechat_api_base` 自配反代
- **文件读**:仓库内 `.aws-article/config.yaml`、`aws.env`、本篇 `article.yaml`、`article.html`、`imgs/*`
- **文件写**:仅本篇 `article.yaml` 的状态字段(`media_id`、`publish_id`、`publish_completed`)
- **shell**:仅 `{python} {baseDir}/scripts/publish.py`、`getdraft.py`、`article_init.py`(`{python}` = 本机 Python 3 解释器,见 [main SKILL 第 0 步](../aws-wechat-article-main/SKILL.md):Windows 用 `py -3 -X utf8`,macOS / Linux 用 `python3`)
**建议**:首次运行用 `publish_method: draft` 只入草稿箱确认效果,再切 `published` 真正群发。
## 配套 skill(informational)
本 skill 是 `aws-wechat-article-*` 一条龙公众号套件的**发布环节**(入口 `aws-wechat-article-main`)。工作流中的若干步骤会读取同级 `../aws-wechat-article-main/references/*.md` 等共享文档(首次引导、articlescreening schema、env/config 示例等)。
- **套件完整装齐到同一 `skills/` 根目录**时,跨 skill 引用都能读到。
- **单独安装本 skill** 时,跨 skill 引用的步骤会在读取阶段遇到 `file not found`;但 `publish.py`、`getdraft.py`、`article_init.py` 这几个脚本本身可独立运行(只要 `aws.env` 与 `.aws-article/config.yaml` 就绪)。
完整 9 slug 清单见 [源码仓库](https://github.com/aiworkskills/wechat-article-skills)。
通过微信公众号 API 将排版稿写入**草稿箱**或再**提交发布**(由 **`config.yaml`** 的 **`publish_method`** 与命令行 **`--publish`** 控制)。
## 配置检查 ⛔
任何操作执行前,**必须**按 **[首次引导](../aws-wechat-article-main/references/first-time-setup.md)** 执行其中的 **「检测顺序」**。检测通过后才能进行以下操作(或用户明确书面确认「本次不检查」):
## 脚本目录
**Agent 执行**:确定本 SKILL.md 所在目录为 `{baseDir}`。发布子命令在 **`{baseDir}/scripts/publish.py`**(项目根执行)。
| 脚本 / 子命令 | 用途 |
|--------|------|
| **`article_init.py`** | 初始化或更新本篇 **`article.yaml`**(及可选 **`closing.md`**)。用于总览 **本篇准备**(建目录后)或 **发布前** 补全元数据。仓库根执行:`{python} {baseDir}/scr_meta.json
{
"ownerId": "kn7f5hvxj1x2ctd5vqnec5x1zs82ce6h",
"slug": "aws-wechat-article-publish",
"version": "1.0.24",
"publishedAt": 1788797242027
}references/api-reference.md
# 微信公众号 API 参考
## 接口一览
| 接口 | 方法 | 路径 | 用途 |
|------|------|------|------|
| 获取 token | GET | `/token` | 获取 access_token |
| 上传永久素材 | POST | `/material/add_material` | 上传封面图,返回 media_id |
| 上传正文图片 | POST | `/media/uploadimg` | 上传正文内图片,返回 URL |
| 新增草稿 | POST | `/draft/add` | 创建图文草稿 |
| 发布草稿 | POST | `/freepublish/submit` | 发布草稿(异步) |
| 查询发布状态 | POST | `/freepublish/get` | 查询发布结果 |
所有接口基础 URL:`https://api.weixin.qq.com/cgi-bin`
## 获取 access_token
```
GET /token?grant_type=client_credential&appid={APPID}&secret={APPSECRET}
```
返回:
```json
{"access_token": "...", "expires_in": 7200}
```
有效期 2 小时,需缓存复用,避免频繁请求。
## 上传封面图(永久素材)
```
POST /material/add_material?access_token={TOKEN}&type=image
Content-Type: multipart/form-data
```
- 字段名:`media`
- 限制:10MB,支持 bmp/png/jpeg/jpg/gif
- 永久素材上限:100,000 张
返回:
```json
{"media_id": "...", "url": "..."}
```
`media_id` 用于 `draft/add` 的 `thumb_media_id` 字段。
## 上传正文图片
```
POST /media/uploadimg?access_token={TOKEN}
Content-Type: multipart/form-data
```
- 字段名:`media`
- 限制:1MB,支持 jpg/png
- 不占用素材库配额
- 返回的 URL 可直接在正文 HTML 中使用
返回:
```json
{"url": "https://mmbiz.qpic.cn/..."}
```
## 新增草稿
```
POST /draft/add?access_token={TOKEN}
Content-Type: application/json
```
请求体:
```json
{
"articles": [{
"title": "标题(≤32字)",
"author": "作者(≤16字)",
"digest": "摘要(≤128字,仅单图文)",
"content": "HTML 正文(≤2万字符,图片 URL 必须来自 uploadimg)",
"thumb_media_id": "封面图 media_id",
"content_source_url": "原文链接",
"need_open_comment": 1,
"only_fans_can_comment": 0
}]
}
```
返回:
```json
{"media_id": "..."}
```
## 发布草稿
```
POST /freepublish/submit?access_token={TOKEN}
Content-Type: application/json
```
请求体:
```json
{"media_id": "草稿的 media_id"}
```
返回:
```json
{"publish_id": "...", "msg_data_id": "..."}
```
**注意**:发布为异步操作,返回成功仅表示任务提交成功。
## 查询发布状态
```
POST /freepublish/get?access_token={TOKEN}
Content-Type: application/json
```
请求体:
```json
{"publish_id": "..."}
```
返回 `publish_status`:
| 值 | 含义 |
|----|------|
| 0 | 发布成功 |
| 1 | 发布中 |
| 2 | 原创失败 |
| 3 | 常规失败 |
| 4 | 平台审核不通过 |
| 5 | 已删除 |
| 6 | 已封禁 |
## 常见错误码
| 错误码 | 含义 | 处理 |
|--------|------|------|
| 40001 | access_token 无效 | 重新获取 token |
| 40004 | 不合法的媒体文件类型 | 检查图片格式 |
| 40009 | 图片大小超限 | 封面 ≤10MB,正文图 ≤1MB |
| 45009 | API 调用超限 | 等待后重试 |
| 45028 | 接口无权限 | 检查公众号类型和权限 |
| 48001 | API 未授权 | 检查公众号开发者设置 |
## 凭证配置
在仓库根 **`aws.env`** 中配置微信槽位(勿提交含真密钥的文件):
```env
NUMBER_ACCOUNTS=1
WECHAT_1_NAME=主号
WECHAT_1_APPID=你的AppID
WECHAT_1_APPSECRET=你的AppSecret
WECHAT_1_API_BASE=
```
键名与 `skills/aws-wechat-article-main/references/env.example.yaml` 一致。多账号递增 `WECHAT_2_*` 等。
## 权限要求
- 需要已认证的服务号或订阅号
- AppID 和 AppSecret 在「开发 → 基本配置」获取
- 调用服务器 IP 需加入白名单
## 官方文档
- [新增草稿](https://developers.weixin.qq.com/doc/subscription/api/draftbox/draftmanage/api_draft_add)
- [发布草稿](https://developers.weixin.qq.com/doc/subscription/api/public/api_freepublish_submit.html)
- [上传永久素材](https://developers.weixin.qq.com/doc/subscription/api/material/permanent/api_addmaterial.html)
- [上传正文图片](htreferences/pre-publish-checklist.md
# 发布前检查清单 在审稿通过后、实际提交前执行,确保可安全发布。 ## 检查项 - [ ] 标题、摘要、作者已最终确认 - [ ] 正文无未替换的占位符或草稿标记 - [ ] 敏感词与错别字已在审稿中修正 - [ ] 封面图已就绪(已上传或路径有效) - [ ] 正文内图片齐全,图注格式正确 - [ ] 原创/转载标注已按配置处理 - [ ] 文末引导区块已就位 - [ ] 如需开启评论/仅粉丝可评,已确认设置 全部勾选后执行提交步骤。
references/submit-guide.md
# 提交到公众号后台
## 方式一:API 提交(推荐)
使用 `skills/aws-wechat-article-publish/scripts/publish.py`,通过微信公众号 API 完成发布。
### 前置准备
1. 在仓库根 **`aws.env`** 中填写微信槽位(与 `skills/aws-wechat-article-main/references/env.example.yaml` 键名一致),例如单账号:
```env
NUMBER_ACCOUNTS=1
WECHAT_1_NAME=主号
WECHAT_1_APPID=你的AppID
WECHAT_1_APPSECRET=你的AppSecret
WECHAT_1_API_BASE=
```
多账号递增 `WECHAT_2_*` 等;发布前可运行 `{python} skills/aws-wechat-article-publish/scripts/publish.py check-wechat-env` 检查缺项。
2. 在公众平台「开发 → 基本配置」中将服务器 IP 加入白名单
3. 准备文章目录:
```
article/
├── article.yaml # 标题、作者、摘要等元信息
├── article.html # 排版后的正文 HTML
├── cover.jpg # 封面图
└── imgs/ # 正文内图片
```
### 一键发布
```bash
# 创建草稿(不发布,可在后台预览)
{python} skills/aws-wechat-article-publish/scripts/publish.py full article/
# 创建草稿并立即发布
{python} skills/aws-wechat-article-publish/scripts/publish.py full article/ --publish
```
### 分步操作
```bash
# 获取 token
{python} skills/aws-wechat-article-publish/scripts/publish.py token
# 上传封面图
{python} skills/aws-wechat-article-publish/scripts/publish.py upload-thumb cover.jpg
# 上传正文图片
{python} skills/aws-wechat-article-publish/scripts/publish.py upload-content-image imgs/img1.png
# 创建草稿(需要先准备好 article.yaml)
{python} skills/aws-wechat-article-publish/scripts/publish.py create-draft article.yaml
# 发布
{python} skills/aws-wechat-article-publish/scripts/publish.py publish <media_id>
# 查询状态
{python} skills/aws-wechat-article-publish/scripts/publish.py status <publish_id>
```
接口详情与错误码:[api-reference.md](api-reference.md)
## 方式二:手动提交
1. 登录微信公众平台(mp.weixin.qq.com)
2. 进入「素材管理」或「草稿箱」→ 新建图文消息
3. 填写标题、作者、摘要
4. 将排版后的正文粘贴到正文编辑区
5. 上传封面图,设置封面
6. 逐一上传正文内图片并插入对应位置
7. 设置评论权限(开启/仅粉丝可评)
8. 保存为草稿或直接群发AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/aiworkskills/skills/aws-wechat-article-publish",
"sourceUrl": "https://clawhub.ai/aiworkskills/skills/aws-wechat-article-publish",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T13:12:22.739Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-aiworkskills-aws-wechat-article-publish/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-aiworkskills-aws-wechat-article-publish/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T13:12:22.739Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.4K downloads",
"href": "https://clawhub.ai/aiworkskills/aws-wechat-article-publish",
"sourceUrl": "https://clawhub.ai/aiworkskills/aws-wechat-article-publish",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T13:12:22.739Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.24",
"href": "https://clawhub.ai/aiworkskills/aws-wechat-article-publish",
"sourceUrl": "https://clawhub.ai/aiworkskills/aws-wechat-article-publish",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-07T16:07:22.027Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-aiworkskills-aws-wechat-article-publish/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-aiworkskills-aws-wechat-article-publish/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.24",
"description": "article.yaml 预设字段表加 default_format_scheme,本篇的排版配色可以落盘。",
"href": "https://clawhub.ai/aiworkskills/aws-wechat-article-publish",
"sourceUrl": "https://clawhub.ai/aiworkskills/aws-wechat-article-publish",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-07T16:07:22.027Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
