@lexiaowen/md2wechat-new 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,236 @@
1
+ md2wechat Source Available License
2
+ Based on Business Source License 1.1
3
+
4
+ ===========================================================
5
+ PARAMETERS
6
+ ===========================================================
7
+
8
+ Licensor: geekjourneyx
9
+
10
+ Licensed Work: md2wechat
11
+ The Licensed Work is (c) 2024-2026 geekjourneyx.
12
+ "Licensed Work" includes the CLI source code, themes,
13
+ layout modules, prompt templates, skill definitions,
14
+ and all associated documentation and assets in this
15
+ repository.
16
+
17
+ Additional Use Grant: You may make production use of the Licensed Work
18
+ solely for the following Personal Non-Commercial
19
+ Purposes, free of charge and without further
20
+ authorization:
21
+
22
+ (a) Individual content creation: creating and
23
+ publishing articles, posts, or media for your own
24
+ personal WeChat Official Account, social media,
25
+ blogs, or other personal channels, provided you
26
+ do not receive direct commercial compensation for
27
+ that specific content. Passive income such as
28
+ platform advertising revenue shares (e.g., WeChat
29
+ Traffic Owner program) does not constitute direct
30
+ commercial compensation under this clause.
31
+
32
+ (b) Learning and research: reading, modifying, or
33
+ adapting the Licensed Work for your own
34
+ understanding or for academic/educational purposes.
35
+
36
+ (c) Evaluation: testing and evaluating the Licensed
37
+ Work for your own non-commercial assessment.
38
+
39
+ (d) Non-profit use: use by registered non-profit
40
+ organizations for non-commercial activities.
41
+
42
+ (e) Contributions: submitting modifications,
43
+ improvements, or bug fixes back to this project.
44
+
45
+ Any use not listed above — including any Commercial
46
+ Purpose as defined below — requires a separate written
47
+ commercial license from the Licensor.
48
+
49
+ "Commercial Purpose" means:
50
+
51
+ (i) offering the Licensed Work, or any product or
52
+ service substantially derived from or powered by
53
+ the Licensed Work (including its themes, layout
54
+ modules, or prompt templates), to third parties
55
+ for a fee or other commercial consideration;
56
+
57
+ (ii) using the Licensed Work internally within any
58
+ for-profit organization in connection with
59
+ revenue-generating activities;
60
+
61
+ (iii) incorporating the Licensed Work or its assets
62
+ (themes, layout modules, prompt templates) into
63
+ any paid software product, paid template, paid
64
+ subscription service, paid training course, or
65
+ paid private community;
66
+
67
+ (iv) using the Licensed Work to deliver services to
68
+ paying clients (design, formatting, publishing,
69
+ consulting, or similar services);
70
+
71
+ (v) rebranding, white-labeling, or redistributing
72
+ the Licensed Work or any substantially similar
73
+ product under a different name or brand, whether
74
+ or not the underlying code is modified, for any
75
+ commercial purpose;
76
+
77
+ (vi) using the Licensed Work, its documentation,
78
+ prompt templates, layout module definitions, or
79
+ theme assets as training data or fine-tuning
80
+ data for any machine learning or artificial
81
+ intelligence model intended for commercial use.
82
+
83
+ Change Date: 2030-01-01
84
+
85
+ Change License: Apache License, Version 2.0
86
+
87
+ Commercial Licensing: For commercial use authorization, please contact:
88
+ Email: skrphper@gmail.com
89
+ Website: https://jieni.ai
90
+ X: https://x.com/seekjourney
91
+ WeChat: search "极客杰尼", leave a message stating
92
+ "商业授权 / Commercial License"
93
+
94
+ ===========================================================
95
+ NOTICE
96
+ ===========================================================
97
+
98
+ Business Source License 1.1
99
+
100
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
101
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
102
+
103
+ This License does not grant you any right in any trademark, logo, or trade
104
+ name of the Licensor or its affiliates, including "md2wechat" and "极客杰尼".
105
+
106
+ ===========================================================
107
+ TERMS
108
+ ===========================================================
109
+
110
+ The Licensor hereby grants you the right to copy, modify, create derivative
111
+ works, redistribute, and make non-production use of the Licensed Work. The
112
+ Licensor may make an Additional Use Grant, above, permitting limited
113
+ production use.
114
+
115
+ Effective on the Change Date, or the fourth anniversary of the first
116
+ publicly available distribution of a specific version of the Licensed Work
117
+ under this License, whichever comes first, the Licensor hereby grants you
118
+ rights under the terms of the Change License, and the rights granted in the
119
+ paragraph above terminate.
120
+
121
+ If your use of the Licensed Work does not comply with the requirements
122
+ currently in effect as described in this License, you must purchase a
123
+ commercial license from the Licensor, its affiliated entities, or authorized
124
+ resellers, or you must refrain from using the Licensed Work.
125
+
126
+ All copies of the original and modified Licensed Work, and derivative works
127
+ of the Licensed Work, are subject to this License. This License applies
128
+ separately for each version of the Licensed Work and the Change Date may
129
+ vary for each version of the Licensed Work released by Licensor.
130
+
131
+ You must conspicuously display this License on each original or modified
132
+ copy of the Licensed Work. If you receive the Licensed Work in original or
133
+ modified form from a third party, the terms and conditions set forth in this
134
+ License apply to your use of that work.
135
+
136
+ Any use of the Licensed Work in violation of this License will automatically
137
+ terminate your rights under this License for the current and all other
138
+ versions of the Licensed Work.
139
+
140
+ This License does not grant you any right in any trademark or logo of
141
+ Licensor or its affiliates (provided that you may use a trademark or logo of
142
+ Licensor as expressly required by this License).
143
+
144
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
145
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
146
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
147
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
148
+ TITLE.
149
+
150
+ ===========================================================
151
+ 中文说明(Chinese Summary)
152
+ ===========================================================
153
+
154
+ 本许可证基于 Business Source License 1.1(BUSL-1.1),并附加个人使用扩展条款。
155
+ 如本中文说明与上方英文条款存在歧义,以英文条款为准。
156
+
157
+ 本作品("Licensed Work")包含 md2wechat 的 CLI 源代码、主题、高级排版模块、
158
+ Prompt 模板、Skill 定义,及本仓库中全部相关文档与资产。
159
+
160
+ 版权所有 © 2024–2026 geekjourneyx
161
+
162
+ ─────────────────────────────────────────
163
+ 一、允许的使用(个人免费,无需授权)
164
+ ─────────────────────────────────────────
165
+
166
+ 以下场景无需申请授权,可免费使用:
167
+
168
+ • 个人内容创作:将 md2wechat 用于为自己的微信公众号、小红书、B站、
169
+ YouTube、个人博客等渠道创作内容,前提是该内容不直接产生商业收益。
170
+ 注:通过微信流量主、平台创作者激励计划获得的广告分成或打赏收入,
171
+ 视为非直接商业报酬,个人创作者可免费使用。若账号以企业或品牌名义
172
+ 运营并产生直接商业收益,则属于商业用途,须获得授权。
173
+
174
+ • 学习与研究:阅读源码、修改代码用于自我学习,或用于学术/教育目的。
175
+
176
+ • 评估与测试:非商业目的的功能体验和测试。
177
+
178
+ • 非营利组织:已登记注册的非营利组织用于非商业活动。
179
+
180
+ • 贡献代码:向本项目提交修改、改进或 Bug 修复。
181
+
182
+ ─────────────────────────────────────────
183
+ 二、禁止的使用(须事先获得书面商业授权)
184
+ ─────────────────────────────────────────
185
+
186
+ 以下场景属于商业用途,未经授权不得使用:
187
+
188
+ • 将本作品(或基于本作品的主题、排版模块、Prompt 模板等衍生成果)作为
189
+ 产品或服务对第三方收费提供;
190
+
191
+ • 在任何营利性组织中将本作品用于与商业运营直接相关的内部工作流;
192
+
193
+ • 基于本作品构建付费软件产品、付费模板、付费订阅服务、付费培训课程或
194
+ 付费私享社群;
195
+
196
+ • 使用本作品为付费客户提供设计、排版、发布等交付服务(外包、咨询等);
197
+
198
+ • 对本作品进行改名(Rebrand)、贴牌(White-label)或以不同品牌名义
199
+ 重新分发,无论底层代码是否经过修改,均须获得商业授权;
200
+
201
+ • 将本作品的源代码、文档、Prompt 模板、排版模块定义或主题资产用作任何
202
+ 以商业为目的的机器学习或人工智能模型的训练数据或微调数据。
203
+
204
+ 违反以上任一条款,即视为侵权,将自动终止你在本许可证下的全部权利。
205
+
206
+ ─────────────────────────────────────────
207
+ 三、自动开源日期(Change Date)
208
+ ─────────────────────────────────────────
209
+
210
+ 2030 年 1 月 1 日之后,本作品各版本将自动以 Apache License 2.0 授权发布。
211
+ 在此日期之前,上述商业用途限制持续有效。
212
+
213
+ ─────────────────────────────────────────
214
+ 四、商业授权联系方式
215
+ ─────────────────────────────────────────
216
+
217
+ 如需获得商业授权,请通过以下任一方式联系作者:
218
+
219
+ 邮件:skrphper@gmail.com
220
+ 官网:https://jieni.ai
221
+ X / Twitter:https://x.com/seekjourney
222
+ 微信公众号:极客杰尼(搜索「极客杰尼」,留言备注「商业授权」)
223
+
224
+ ─────────────────────────────────────────
225
+ 五、关于历史版本
226
+ ─────────────────────────────────────────
227
+
228
+ 本项目在此许可证生效前的历史版本以 MIT 许可证发布,该授权不受本许可证
229
+ 影响。本许可证自其生效提交(commit)起,适用于所有后续版本。
230
+
231
+ ─────────────────────────────────────────
232
+ 六、免责声明
233
+ ─────────────────────────────────────────
234
+
235
+ 本作品按「现状」提供,不附带任何明示或默示担保。作者不对因使用本作品
236
+ 造成的任何直接或间接损失承担责任。
package/README.md ADDED
@@ -0,0 +1,411 @@
1
+ <div align="center">
2
+
3
+ <h1>
4
+ <img src="assets/favicon.ico" alt="md2wechat logo" width="28" />
5
+ md2wechat
6
+ </h1>
7
+
8
+ <img src="assets/readme-header.gif" alt="md2wechat — 公众号创作全流程 CLI" width="720" />
9
+
10
+ **专为 AI 时代设计的公众号创作工作台**
11
+
12
+ 写 Markdown · 43 个高级排版模块 · 40+ 专业主题 · AI 配图 · 推送草稿箱<br/>
13
+ 全流程 CLI,Agent-native — Claude Code · Codex · OpenClaw 原生支持
14
+
15
+ [![Go Version](https://img.shields.io/badge/Go-1.26.1+-00ADD8?logo=go)](https://golang.org)
16
+ [![License](https://img.shields.io/badge/license-Source%20Available-orange)](LICENSE)
17
+ [![GitHub Release](https://img.shields.io/badge/download-latest-green)](https://github.com/lexiaowenn/md2wechat-new/releases)
18
+ [![Claude Code](https://img.shields.io/badge/Claude%20Code-Skill-purple)](#coding-agent)
19
+ [![OpenClaw](https://img.shields.io/badge/OpenClaw-Compatible-00b0aa)](#openclaw)
20
+ [![zread](https://img.shields.io/badge/Ask_Zread-_.svg?style=flat&color=00b0aa&labelColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42MDE1NiAyLjI0MDFWNC45NjAxQzEuNjAxNTYgNS4zMTM1NiAxLjg4ODEgNS42MDAxIDIuMjQxNTYgNS42MDAxSDQuOTYxNTZDNS4zMTUwMiA1LjYwMDEgNS42MDE1NiA1LjMxMzU2IDUuNjAxNTYgNC45NjAxVjIuMjQwMUM1LjYwMTU2IDEuODg2NjQgNS4zMTUwMiAxLjYwMDEgNC45NjE1NiAxLjYwMDFaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00Ljk2MTU2IDEwLjM5OTlIMi4yNDE1NkMxLjg4ODEgMTAuMzk5OSAxLjYwMTU2IDEwLjY4NjQgMS42MDE1NiAxMS4wMzk5VjEzLjc1OTlDMS42MDE1NiAxNC4xMTM0IDEuODg4MSAxNC4zOTk5IDIuMjQxNTYgMTQuMzk5OUg0Ljk2MTU2QzUuMzE1MDIgMTQuMzk5OSA1LjYwMTU2IDE0LjExMzQgNS42MDE1NiAxMy43NTk5VjExLjAzOTlDNS42MDE1NiAxMC42ODY0IDUuMzE1MDIgMTAuMzk5OSA0Ljk2MTU2IDEwLjM5OTlaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik0xMy43NTg0IDEuNjAwMUgxMS4wMzg0QzEwLjY4NSAxLjYwMDEgMTAuMzk4NCAxLjg4NjY0IDEwLjM5ODQgMi4yNDAxVjQuOTYwMUMxMC4zOTg0IDUuMzEzNTYgMTAuNjg1IDUuNjAwMSAxMS4wMzg0IDUuNjAwMUgxMy43NTg0QzE0LjExMTkgNS42MDAxIDE0LjM5ODQgNS4zMTM1NiAxNC4zOTg0IDQuOTYwMVYyLjI0MDFDMTQuMzk4NCAxLjg4NjY0IDE0LjExMTkgMS42MDAxIDEzLjc1ODQgMS42MDAxWiIgZmlsbD0iI2ZmZiIvPgo8cGF0aCBkPSJNNCAxMkwxMiA0TDQgMTJaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00IDEyTDEyIDQiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K&logoColor=ffffff)](https://zread.ai/lexiaowenn/md2wechat-new)
21
+
22
+ [快速开始](#quickstart) · [高级排版](#layout) · [API 解锁](#api) · [Agent 支持](#coding-agent) · [常见问题](#faq)
23
+
24
+ </div>
25
+
26
+ ---
27
+
28
+ ## 为什么不是另一个转换器
29
+
30
+ 市面上有很多 Markdown 排版工具,md2wechat 不一样的地方:
31
+
32
+ | | 其他工具 | md2wechat |
33
+ |---|---|---|
34
+ | **输出一致性** | LLM 每次不同 | API 模式确定性输出,同样 Markdown 永远相同 |
35
+ | **排版系统** | 靠 prompt 碰运气 | 43 个结构化排版模块(`:::block` 语法),API 专属 |
36
+ | **主题数量** | 无 / 寥寥几个 | 40+ 专业主题,微信渲染精调 |
37
+ | **全流程** | 只做格式转换 | 写作 → 去 AI 痕 → 排版 → AI 配图 → 上传 → 推送草稿 |
38
+ | **Agent 集成** | 无结构约定 | JSON envelope、capabilities 端点、discovery 命令 |
39
+
40
+ ---
41
+
42
+ <a id="api"></a>
43
+
44
+ ## API 模式 — 解锁完整体验
45
+
46
+ > **AI 模式**(免费):生成排版 prompt,由你的 Claude / Codex 继续处理,3 个基础主题。
47
+ >
48
+ > **API 模式**(专业服务):秒级响应,40+ 主题,43 个高级排版模块,确定性输出,团队协作与自动化发布首选。
49
+
50
+ **API 模式专属能力:**
51
+
52
+ - ✦ **43 个高级排版模块** — `:::block hero`、`:::block callout`、`:::block timeline`… 结构化公众号内容设计语言,详见 [高级排版指南](#layout)
53
+ - ✦ **40+ 专业主题** — Minimal · Focus · Elegant · Bold 四大系列,微信渲染精调,完整预览 [theme-gallery](https://md2wechat-new.app/theme-gallery)
54
+ - ✦ **确定性输出** — 同样 Markdown 每次结果完全一致,适合团队协作和自动化发布
55
+ - ✦ **秒级响应** — 无需等待 LLM 生成,适合高频发布场景
56
+
57
+ **申请 API 服务 / 加入微信交流群:**
58
+
59
+ 扫描下方二维码关注 **极客杰尼** 公众号 → 备注 **「API咨询」** 联系作者;或备注 **「交流群」** 申请加入用户交流群,和同类创作者一起探索 AI 驱动的公众号创作。
60
+
61
+ **限时加入下面👇的公众号创作交流群获取第一时间更新资讯(人满200为止),谢绝一切广告,推广等信息,一律踢出**
62
+
63
+ <p align="center">
64
+ <img width="160" alt="image" src="https://github.com/user-attachments/assets/ec0135fc-68e8-463e-8b4c-6348ff9631c3" />
65
+ <img src="assets/wechat.png" alt="公众号:极客杰尼" width="160" />
66
+ </p>
67
+
68
+
69
+ ---
70
+
71
+ <a id="quickstart"></a>
72
+
73
+ ## 快速开始
74
+
75
+ ### 第一步:安装
76
+
77
+ ```bash
78
+ # macOS 优先推荐
79
+ brew install lexiaowenn/tap/md2wechat-new
80
+ ```
81
+
82
+ 其他安装方式(npm / go install / install.sh / Windows PowerShell)见 [安装指南](docs/INSTALL.md)。
83
+
84
+ npm 全局安装也可以直接用:
85
+
86
+ ```bash
87
+ npm install -g @lexiaowen/md2wechat-new
88
+ ```
89
+
90
+ ### 第二步:配置微信(只需一次)
91
+
92
+ ```bash
93
+ md2wechat config init
94
+ # 打开生成的配置文件,填入微信公众号 AppID 和 Secret
95
+ ```
96
+
97
+ AppID / Secret 获取方式与 IP 白名单配置详见 [微信凭证指南](docs/WECHAT-CREDENTIALS.md)。
98
+
99
+ ### 第三步:开始创作
100
+
101
+ ```bash
102
+ # 确认文章解析结果(推荐第一步总是先 inspect)
103
+ md2wechat inspect article.md
104
+
105
+ # 本地预览 HTML(不触发上传或草稿副作用)
106
+ md2wechat preview article.md
107
+
108
+ # 转换并推送微信草稿箱
109
+ md2wechat convert article.md --draft --cover cover.jpg
110
+ ```
111
+
112
+ 如果你想把上面的步骤直接发给 Agent 执行,见 [Agent 安装脚本](docs/INSTALL.md#agent-script)。
113
+
114
+ <p align="center">
115
+ <img src="assets/transform.gif" alt="md2wechat 转换演示" width="720" />
116
+ </p>
117
+
118
+ ---
119
+
120
+ ## 核心能力
121
+
122
+ ### 命令速览
123
+
124
+ | 命令 | 说明 |
125
+ |------|------|
126
+ | `inspect` | 解析文章元数据与发布 readiness,确认层,推荐 `convert` 前先跑 |
127
+ | `preview` | 生成本地预览 HTML,不触发任何上传或草稿副作用 |
128
+ | `convert` | Markdown → 微信格式 HTML,可选 `--draft` 直接推送草稿 |
129
+ | `write` | 风格写作,从一个想法生成完整文章 + 封面提示词 |
130
+ | `humanize` | AI 去痕,让 AI 生成的文章听起来像真人写的 |
131
+ | `generate_cover` | AI 生成封面图,内置专业 preset |
132
+ | `generate_infographic` | AI 生成信息图,内置 10+ 风格 preset |
133
+ | `upload_image` | 上传图片到微信永久素材库 |
134
+
135
+ ### 全流程示例
136
+
137
+ ```bash
138
+ # 从一个想法到草稿箱,全流程 4 步
139
+ md2wechat write --style dan-koe # 1. 生成文章 + 封面提示词
140
+ md2wechat humanize article.md # 2. 去除 AI 痕迹
141
+ md2wechat generate_cover --article article.md # 3. AI 生成封面图
142
+ md2wechat convert article.md --draft --cover cover.jpg # 4. 推送草稿
143
+ ```
144
+
145
+ 在 Claude Code 中可以直接发自然语言:
146
+
147
+ ```
148
+ "用 Dan Koe 风格写一篇关于 AI 时代独立开发者的文章,生成封面,推送到微信草稿箱"
149
+ ```
150
+
151
+ ---
152
+
153
+ <a id="layout"></a>
154
+
155
+ ## 高级排版模块(API 专属)
156
+
157
+ > **仅 API 模式可用。** 高级排版模块是 md2wechat 独有的能力 — 基于 `:::block` 语法,提供 43 个结构化排版组件,是专为微信公众号设计的内容排版语言。不是 prompt,是一套确定性的设计系统。
158
+
159
+ ### `:::block` 语法示例
160
+
161
+ 在 Markdown 中用 `:::` 包裹排版块:
162
+
163
+ ```markdown
164
+ :::block hero
165
+ eyebrow: 深度观察
166
+ title: AI 时代的公众号写作
167
+ subtitle: 为什么你需要重新定义「好内容」
168
+ :::
169
+
170
+ :::block callout type=tip
171
+ 高级排版模块仅在 API 模式下生效。需要配置 OpenAI-compatible 文本 API Key。
172
+ :::
173
+
174
+ :::block timeline
175
+ - 2024:GPT-4 发布,内容生产门槛归零
176
+ - 2025:AI 写作工具爆发,同质化严重
177
+ - 2026:高质量、有视角的内容成为稀缺品
178
+ :::
179
+ ```
180
+
181
+ ### 发现与验证命令
182
+
183
+ ```bash
184
+ # 列出全部 43 个模块
185
+ md2wechat layout list --json
186
+
187
+ # 按用途筛选
188
+ md2wechat layout list --serves attention --json
189
+ md2wechat layout list --serves conversion --json
190
+
191
+ # 查看模块完整规格
192
+ md2wechat layout show hero --json
193
+
194
+ # 验证文章中的 :::block 用法
195
+ md2wechat layout validate --file article.md --json
196
+ ```
197
+
198
+ 保姆级教程(43 个模块全覆盖)见 [docs/LAYOUT.md](docs/LAYOUT.md)。
199
+
200
+ ---
201
+
202
+ ## Agent 发现命令
203
+
204
+ 在 Coding Agent 或自动化脚本中,先执行 discovery 命令,不要靠猜:
205
+
206
+ ```bash
207
+ md2wechat capabilities --json # 当前实例能力总览与默认配置
208
+ md2wechat themes list --json # 所有可用主题
209
+ md2wechat prompts list --kind image --json # 图片 prompt catalog
210
+ md2wechat providers list --json # 图片生成 provider
211
+ md2wechat layout list --json # 高级排版模块列表
212
+ ```
213
+
214
+ 所有命令加 `--json` 后 stdout 只输出 JSON envelope,适合脚本和 Agent 直接消费。
215
+
216
+ ---
217
+
218
+ ## AI 模式 vs API 模式
219
+
220
+ | | AI 模式(免费) | API 模式(专业) |
221
+ |---|---|---|
222
+ | **是否需要 API Key** | 不需要 | 需要文本 API Key |
223
+ | **输出方式** | 生成 prompt,由外部 LLM 继续处理 HTML | 直接返回最终 HTML |
224
+ | **主题数量** | 3 个(autumn-warm / spring-fresh / ocean-calm) | 40+ 个 |
225
+ | **高级排版模块** | ❌ | ✅ 43 个 |
226
+ | **输出一致性** | 每次不同 | 确定性,同样输入同样输出 |
227
+ | **响应速度** | 取决于外部 LLM | 秒级 |
228
+ | **适合场景** | 实验、偶发写作 | 品牌内容、团队协作、自动化发布 |
229
+
230
+ ```bash
231
+ # AI 模式(--mode ai,不需要 API Key)
232
+ md2wechat convert article.md --mode ai --theme autumn-warm --preview
233
+
234
+ # API 模式(默认,需要 TEXT_API_KEY)
235
+ md2wechat convert article.md --preview
236
+ ```
237
+
238
+ ---
239
+
240
+ <a id="coding-agent"></a>
241
+
242
+ ## Coding Agent 支持
243
+
244
+ md2wechat 是 CLI-first 工具,天然适合集成进 Coding Agent。
245
+
246
+ ```bash
247
+ # 安装 CLI(先装这个)
248
+ brew install lexiaowenn/tap/md2wechat-new
249
+
250
+ # 安装 skill(Claude Code / Codex / OpenCode)
251
+ npx skills add https://github.com/lexiaowenn/md2wechat-new --skill md2wechat
252
+ ```
253
+
254
+ 安装后在 Claude Code 中直接用自然语言驱动:
255
+
256
+ ```
257
+ "把 article.md 转换为微信格式,用 elegant-gold 主题,生成封面图,推送到草稿箱"
258
+ "帮我检查这篇文章的发布 readiness,然后预览一下排版效果"
259
+ ```
260
+
261
+ ### 支持的平台
262
+
263
+ | 平台 | skill 路径 | 安装文档 |
264
+ |------|------------|---------|
265
+ | Claude Code / Codex / OpenCode | `skills/md2wechat/` | `npx skills add ...` |
266
+ | Obsidian(Claudian 插件) | `~/.claude/skills/` | [docs/OBSIDIAN.md](docs/OBSIDIAN.md) |
267
+ | OpenClaw | `platforms/openclaw/md2wechat/` | [docs/OPENCLAW.md](docs/OPENCLAW.md) |
268
+
269
+ <a id="openclaw"></a>
270
+
271
+ OpenClaw 用户可以通过 ClawHub 直接安装:[clawhub.ai/lexiaowenn/md2wechat-new](https://clawhub.ai/lexiaowenn/md2wechat-new)
272
+
273
+ ```bash
274
+ curl -fsSL https://github.com/lexiaowenn/md2wechat-new/releases/download/v2.0.7/install-openclaw.sh | bash
275
+ ```
276
+
277
+ ---
278
+
279
+ ## 图片生成
280
+
281
+ 支持多种 AI 图片生成服务,用于封面图、信息图和文章配图:
282
+
283
+ | 服务 | 推荐 | 说明 |
284
+ |------|------|------|
285
+ | Volcengine Ark | ⭐ 主推荐 | 豆包 Seedream 系列,高质量,国内直连 |
286
+ | ModelScope | 次推荐 | 有免费额度,国内访问稳定 |
287
+ | OpenRouter | 通用 | 多模型聚合,支持 Gemini / Flux |
288
+ | OpenAI | 通用 | 官方 DALL-E |
289
+ | Google Gemini | 通用 | 官方 Gemini 图片生成 |
290
+
291
+ 配置方式详见 [图片服务配置指南](docs/IMAGE_PROVISIONERS.md)。
292
+
293
+ ---
294
+
295
+ ## 文档
296
+
297
+ | 文档 | 说明 |
298
+ |------|------|
299
+ | [快速入门](docs/QUICKSTART.md) | 详细图文教程,新手优先看这里 |
300
+ | [完整使用说明](docs/USAGE.md) | 所有命令和选项 |
301
+ | [高级排版模块](docs/LAYOUT.md) | :::block 语法保姆级教程,43 个模块全覆盖 |
302
+ | [能力发现](docs/DISCOVERY.md) | discovery 命令与 Prompt Catalog |
303
+ | [安装指南](docs/INSTALL.md) | 多平台安装(npm / go / install.sh / Windows) |
304
+ | [配置指南](docs/CONFIG.md) | 配置文件与环境变量完整说明 |
305
+ | [图片服务配置](docs/IMAGE_PROVISIONERS.md) | AI 图片生成服务配置 |
306
+ | [微信凭证指南](docs/WECHAT-CREDENTIALS.md) | AppID / Secret / IP 白名单 |
307
+ | [常见问题](docs/FAQ.md) | 20+ 问题解答 |
308
+ | [故障排查](docs/TROUBLESHOOTING.md) | 遇到问题看这里 |
309
+ | [OpenClaw 指南](docs/OPENCLAW.md) | OpenClaw 平台安装与配置 |
310
+ | [Obsidian 指南](docs/OBSIDIAN.md) | Claudian 插件集成 |
311
+
312
+ ---
313
+
314
+ <a id="faq"></a>
315
+
316
+ ## 常见问题
317
+
318
+ **Q: 没有 API Key 可以用吗?**
319
+
320
+ 可以。AI 模式不需要 API Key,直接加 `--mode ai` 即可。API 模式需要配置 OpenAI、DeepSeek、硅基流动或自定义 OpenAI-compatible API。
321
+
322
+ **Q: 高级排版模块(:::block)只有 API 模式才有?**
323
+
324
+ 是的。43 个结构化排版模块是 API 服务的核心能力,不依赖外部 LLM,输出确定。
325
+
326
+ **Q: AI 模式和 API 模式有什么本质区别?**
327
+
328
+ AI 模式返回一个结构化排版 prompt,需要 Claude / Codex 继续处理才能得到 HTML。API 模式直接返回最终 HTML,40+ 主题,确定性输出,无需额外 LLM。
329
+
330
+ **Q: 必须会编程才能用吗?**
331
+
332
+ 不需要。会用命令行即可。在 Claude Code / Codex 中可以全程用自然语言驱动,Agent 自动调用 CLI 命令。
333
+
334
+ **Q: 发送草稿时报错 45002(内容超限)?**
335
+
336
+ 微信草稿 API 限制 < 20,000 字符。API 模式的 inline CSS 会使内容体积膨胀,长文章建议拆分,或使用更简洁的主题。详见 [常见问题](docs/FAQ.md)。
337
+
338
+ 更多问题见 [docs/FAQ.md](docs/FAQ.md)。
339
+
340
+ ---
341
+
342
+ ## md2wechat 生态
343
+
344
+ 围绕 md2wechat 打造的工具和资源矩阵,持续扩展中:
345
+
346
+ | 仓库 | 说明 |
347
+ |------|------|
348
+ | [md2wechat](https://github.com/md2wechat-new) | 品牌主页,所有工具和资源的入口 |
349
+ | [md2wechat-guide](https://github.com/md2wechat-new/md2wechat-guide) | 从入门到 API 的完整使用指南 |
350
+ | [awesome-wechat-markdown](https://github.com/md2wechat-new/awesome-wechat-markdown) | 微信公众号 Markdown 工具精选列表 |
351
+ | [md2wechat-templates](https://github.com/md2wechat-new/md2wechat-templates) | 开箱即用的排版模板库 |
352
+
353
+ ---
354
+
355
+ ## 关于作者
356
+
357
+ **极客杰尼** — 独立开发者 / AI Builder / AI 科技领域博主
358
+
359
+ 持续打磨面向 AI Agent 的 CLI、API 与公众号自动化工作流。
360
+
361
+ | | |
362
+ |:---|:---|
363
+ | 个人主页 | [jieni.ai](https://jieni.ai) |
364
+ | GitHub | [geekjourneyx](https://github.com/geekjourneyx) |
365
+ | Twitter | [@seekjourney](https://x.com/seekjourney) |
366
+ | 公众号 | 微信搜「极客杰尼」 |
367
+
368
+ **欢迎加入微信交流群** — 扫码关注公众号,备注 **「交流群」** 申请入群;备注 **「API咨询」** 申请 API 服务:
369
+
370
+ <p align="center">
371
+ <img src="assets/wechat.png" alt="公众号:极客杰尼" width="160" />
372
+ </p>
373
+
374
+ ---
375
+
376
+ ## 打赏
377
+
378
+ 如果该项目帮助了你,欢迎请作者喝杯咖啡 ☕
379
+
380
+ <img src="https://raw.githubusercontent.com/geekjourneyx/awesome-developer-go-sail/main/docs/assets/wechat-reward-code.jpg" alt="微信打赏码" width="160" />
381
+
382
+ ---
383
+
384
+ ## 贡献
385
+
386
+ 欢迎提交 Issue 和 Pull Request!有好想法或发现 Bug,随时提 issue。
387
+
388
+ ---
389
+
390
+ ## Star History
391
+
392
+ <a href="https://www.star-history.com/?repos=lexiaowenn%2Fmd2wechat-new&type=date&legend=top-left">
393
+ <picture>
394
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=lexiaowenn/md2wechat-new&type=date&theme=dark&legend=top-left" />
395
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=lexiaowenn/md2wechat-new&type=date&legend=top-left" />
396
+ <img alt="Star History Chart" src="https://api.star-history.com/image?repos=lexiaowenn/md2wechat-new&type=date&legend=top-left" />
397
+ </picture>
398
+ </a>
399
+
400
+
401
+ ---
402
+
403
+ <div align="center">
404
+
405
+ **让公众号创作回归写作本身**
406
+
407
+ [主页](https://github.com/lexiaowenn/md2wechat-new) · [文档](docs) · [生态](https://github.com/md2wechat-new) · [反馈](https://github.com/lexiaowenn/md2wechat-new/issues)
408
+
409
+ Made with ♥ by [geekjourneyx](https://jieni.ai) · [Source Available License](LICENSE) · Personal use free · [Commercial licensing](mailto:skrphper@gmail.com)
410
+
411
+ </div>
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@lexiaowen/md2wechat-new",
3
+ "version": "2.2.0",
4
+ "description": "Configurable-provider fork of the md2wechat CLI.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/lexiaowenn/md2wechat-new.git"
9
+ },
10
+ "homepage": "https://github.com/lexiaowenn/md2wechat-new#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/lexiaowenn/md2wechat-new/issues"
13
+ },
14
+ "bin": {
15
+ "md2wechat": "scripts/run.js"
16
+ },
17
+ "scripts": {
18
+ "pack:check": "npm pack --json --dry-run",
19
+ "postinstall": "node scripts/install.js"
20
+ },
21
+ "files": [
22
+ "scripts/install.js",
23
+ "scripts/run.js",
24
+ "README.md",
25
+ "CHANGELOG.md",
26
+ "LICENSE"
27
+ ],
28
+ "engines": {
29
+ "node": ">=18"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
34
+ }