npx claudepluginhub hocgin/agent-skills --plugin template-skillsThis skill uses the workspace's default tool permissions.
- **渲染**:将 Markdown 转换为微信公众号兼容的 HTML
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Share bugs, ideas, or general feedback.
pnpm install -g @hocgin/wenyan-cli
将 Markdown 渲染为 HTML 并发布到微信公众号。
# 从字符串输入发布
wenyan publish "Hello World" --appId your_app_id --appSecret your_app_secret
# 从文件发布
wenyan publish -f README.md --appId your_app_id --appSecret your_app_secret
# 从 URL 发布
wenyan publish -f https://example.com/article.md --appId your_app_id --appSecret your_app_secret
# 通过远程服务器发布
wenyan publish -f article.md \
--server https://api.yourdomain.com \
--api-key your_api_key
--appId your_app_id \
--appSecret your_app_secret \
将 Markdown 渲染为 HTML,不发布。
# 从字符串渲染
wenyan render "# Hello World"
# 从文件渲染
wenyan render -f README.md
# 输出到文件
wenyan render -f README.md > output.html
管理内置和自定义主题。
# 列出所有主题
wenyan theme --list
# 添加自定义主题
wenyan theme --add --name my-theme --path /path/to/theme.css
# 删除自定义主题
wenyan theme --rm my-theme
启动 HTTP API 服务器提供渲染和发布接口。
# 启动服务器(默认端口 3000)
wenyan serve
# 指定端口
wenyan serve -p 8080
# 启用 API 认证
wenyan serve --api-key your_secret_key
使用 AI 服务生成图片。
# 使用七牛云生图
wenyan image \
--service qiniu \
--model kling-v1-5 \
--token your_token \
--prompt "一只可爱的小猫" \
--path ./output.png \
--timeout 180 \
--aspect-ratio 16:9
发布已有的草稿文章。
wenyan submit \
--appId your_app_id \
--appSecret your_app_secret \
--mediaId your_media_id
适用于 publish 和 render 命令:
| 选项 | 简写 | 说明 | 默认值 |
|---|---|---|---|
-f, --file <path> | 从本地文件或 URL 读取 Markdown | - | |
--server <url> | 远程 Wenyan Server 地址 | - | |
--api-key <apiKey> | 远程服务密钥 | - | |
--appId <appId> | 本地直连公众号 API 的 appId | - | |
--appSecret <appSecret> | 本地直连公众号 API 的 appSecret | - | |
-t, --theme <theme-id> | 排版主题 | default | |
-h, --highlight <theme-id> | 代码高亮主题 | solarized-light | |
-c, --custom-theme <path> | 自定义主题 CSS | - | |
--no-mac-style | 禁用 Mac 风格代码块 | 启用 | |
--no-footnote | 禁用脚注转换 | 启用 |
# 1. 渲染并发布文章
wenyan publish -f article.md \
--appId wx1234567890abcdef \
--appSecret your_secret_key \
--theme github \
--highlight monokai
# 2. 仅预览渲染结果
wenyan render -f article.md > preview.html
# 3. 添加自定义主题后发布
wenyan theme --add --name my-brand --path brand.css
wenyan publish -f article.md --theme my-brand
# 1. 启动服务器
wenyan serve -p 3000 --api-key secret_key
# 2. 客户端通过服务器发布
wenyan publish -f article.md \
--server http://localhost:3000 \
--api-key secret_key
# 生成文章配图
wenyan image \
--service qiniu \
--model kling-v1-5 \
--token your_qiniu_token \
--prompt "科技感未来城市" \
--path ./images/cover.png \
--aspect-ratio 16:9
# 发布文章(可配合使用)
wenyan publish -f article.md --appId your_app_id --appSecret your_secret
必须在 Markdown 顶部包含一段 frontmatter:
---
title: 文章标题
cover: ./cover.jpg
author: 作者名称
source_url: https://example.com
---
字段说明:
| 字段 | 必填 | 说明 |
|---|---|---|
| title | 是 | 文章标题 |
| cover | 否 | 封面图片(本地路径或网络 URL) |
| author | 否 | 作者 |
| source_url | 否 | 原文链接 |
说明:
所有命令都包含统一的错误处理:
wenyan theme --list
检查 appId 和 appSecret 是否正确,确保网络连接正常。
调整 --timeout 参数(默认 180 秒)。