Skip to content

feat: 支持 publish-image 命令(小绿书图文发布)#27

Open
jrtxio wants to merge 3 commits intocaol64:mainfrom
jrtxio:feat/newspic-support
Open

feat: 支持 publish-image 命令(小绿书图文发布)#27
jrtxio wants to merge 3 commits intocaol64:mainfrom
jrtxio:feat/newspic-support

Conversation

@jrtxio
Copy link
Copy Markdown

@jrtxio jrtxio commented Apr 17, 2026

Summary

  • 新增 publish-image CLI 命令,支持发布图片消息(小绿书)
  • 支持多张图片上传(-i img1.jpg img2.jpg ...,最多 20 张)
  • 支持指定封面图(--cover),默认使用第一张图片
  • 依赖 @wenyan-md/core ^3.0.5(对应 PR: feat: 支持发布图片消息(小绿书) wenyan-core#13

Usage

# 基本用法
wenyan publish-image "这是图片消息的描述文字" -i photo1.jpg photo2.jpg photo3.jpg

# 从文件读取文字内容
wenyan publish-image -f description.txt -i photo1.jpg photo2.jpg

# 指定封面和作者
wenyan publish-image "描述" -i img1.jpg img2.jpg --cover cover.jpg --author "作者名"

Dependencies

需要先合并 core 仓库的 PR: caol64/wenyan-core#13

🤖 Generated with Claude Code

Add `publish-image` CLI command that supports uploading multiple images
with text content to WeChat MP draft box as newspic article type.

Usage: wenyan publish-image "描述文字" -i img1.jpg img2.jpg img3.jpg

Requires @wenyan-md/core ^3.0.5 for publishImageTextToWechatDraft.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jrtxio jrtxio force-pushed the feat/newspic-support branch from 11a39d0 to 0cbb059 Compare April 20, 2026 10:20
- serve.ts 新增 POST /publish-image 端点处理小绿书发布
- cli.ts publish-image 命令新增 --server/--api-key 选项
- 设置 --server 时走服务器模式,否则走本地模式

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增 parseImageTextMarkdown 解析 frontmatter(author/cover)和图片引用
- -f 指定 markdown 文件为主流程,从中提取图片路径和文字内容
- 保留 -i 纯 CLI 参数模式作为向后兼容
- CLI 的 --author/--cover 可覆盖文件中的 frontmatter 值
- 传 relativePath 给 core 以正确解析相对路径图片

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant