aiconductor-cli 1.6.0 → 1.8.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.
Files changed (92) hide show
  1. package/README.md +582 -488
  2. package/bin/aiconductor-cli.js +412 -351
  3. package/package.json +1 -1
  4. package/src/api.js +151 -3
  5. package/src/api.test.js +360 -4
  6. package/src/commands/content.js +184 -184
  7. package/src/commands/douyin.js +252 -0
  8. package/src/commands/html_publish.js +54 -54
  9. package/src/commands/md_publish.js +175 -175
  10. package/src/commands/web.js +69 -0
  11. package/src/commands/web_search.js +99 -99
  12. package/src/commands/wx.js +116 -116
  13. package/src/commands/xhs.js +763 -609
  14. package/src/lib/cli-utils.js +172 -172
  15. package/src/lib/daren-score.js +91 -0
  16. package/src/lib/daren-score.test.js +57 -0
  17. package/AGENTS.md +0 -193
  18. package/api_docs/aic_web_search.md +0 -84
  19. package/api_docs/audio_converter.md +0 -51
  20. package/api_docs/balance_query.md +0 -38
  21. package/api_docs/bing_search.md +0 -55
  22. package/api_docs/china_stock_data.md +0 -221
  23. package/api_docs/delete_published_webpage.md +0 -38
  24. package/api_docs/doubao_search.md +0 -80
  25. package/api_docs/douyin_link_to_text_v1.md +0 -50
  26. package/api_docs/douyin_link_to_text_v2.md +0 -50
  27. package/api_docs/douyin_user_detail.md +0 -65
  28. package/api_docs/douyin_user_search.md +0 -58
  29. package/api_docs/douyin_user_videos.md +0 -49
  30. package/api_docs/douyin_user_videos_async.md +0 -45
  31. package/api_docs/douyin_user_videos_async_query.md +0 -41
  32. package/api_docs/douyin_user_videos_max.md +0 -59
  33. package/api_docs/douyin_video_comments.md +0 -68
  34. package/api_docs/douyin_video_info.md +0 -70
  35. package/api_docs/douyin_video_search.md +0 -60
  36. package/api_docs/douyin_video_search_fast.md +0 -48
  37. package/api_docs/fast_ocr.md +0 -51
  38. package/api_docs/flow_article2podcast_creat.md +0 -41
  39. package/api_docs/flow_article2podcast_query.md +0 -41
  40. package/api_docs/flow_wx_history_articles.md +0 -45
  41. package/api_docs/generate_image.md +0 -68
  42. package/api_docs/get_duration.md +0 -37
  43. package/api_docs/hot_list_mixed.md +0 -122
  44. package/api_docs/html_publish.md +0 -50
  45. package/api_docs/html_publish_flexible.md +0 -65
  46. package/api_docs/image_resize.md +0 -58
  47. package/api_docs/image_to_permalink.md +0 -61
  48. package/api_docs/link_expander.md +0 -39
  49. package/api_docs/llm_proxy.md +0 -61
  50. package/api_docs/markitdown.md +0 -47
  51. package/api_docs/md_to_docx.md +0 -51
  52. package/api_docs/md_to_html.md +0 -53
  53. package/api_docs/md_to_mindmap.md +0 -52
  54. package/api_docs/md_to_pdf.md +0 -52
  55. package/api_docs/md_to_png.md +0 -53
  56. package/api_docs/md_to_txt.md +0 -51
  57. package/api_docs/md_to_wxhtml.md +0 -64
  58. package/api_docs/md_to_xhs.md +0 -87
  59. package/api_docs/md_to_xlsx.md +0 -52
  60. package/api_docs/portrait_enhancement.md +0 -69
  61. package/api_docs/published_webpages.md +0 -45
  62. package/api_docs/r2_uploader.md +0 -51
  63. package/api_docs/schedulerx_job_create.md +0 -56
  64. package/api_docs/transaction_query.md +0 -52
  65. package/api_docs/url_to_markdown.md +0 -50
  66. package/api_docs/video_download_url.md +0 -57
  67. package/api_docs/video_download_url_oss.md +0 -55
  68. package/api_docs/video_to_text.md +0 -48
  69. package/api_docs/video_to_text_v2.md +0 -49
  70. package/api_docs/volcengine_face_pretty.md +0 -55
  71. package/api_docs/volcengine_faceswap.md +0 -55
  72. package/api_docs/website_screenshot.md +0 -49
  73. package/api_docs/wx_access_token.md +0 -44
  74. package/api_docs/wx_article_analysis_data_push.md +0 -43
  75. package/api_docs/wx_article_data.md +0 -48
  76. package/api_docs/wx_article_style_rewrite.md +0 -45
  77. package/api_docs/wx_draft_add.md +0 -56
  78. package/api_docs/wx_draft_publish.md +0 -47
  79. package/api_docs/wx_history_articles.md +0 -89
  80. package/api_docs/wx_image_upload.md +0 -46
  81. package/api_docs/wx_md_to_html.md +0 -48
  82. package/api_docs/wx_rss_reader.md +0 -59
  83. package/api_docs/xhs_hot_list.md +0 -48
  84. package/api_docs/xhs_note_comments_fast.md +0 -54
  85. package/api_docs/xhs_note_info_v2.md +0 -45
  86. package/api_docs/xhs_note_info_v3.md +0 -69
  87. package/api_docs/xhs_note_publish.md +0 -54
  88. package/api_docs/xhs_note_search_v2.md +0 -73
  89. package/api_docs/xhs_note_search_v3.md +0 -54
  90. package/api_docs/xhs_user_info_v2.md +0 -61
  91. package/api_docs/xhs_user_notes_v2.md +0 -56
  92. package/api_docs/xhs_user_notes_v3.md +0 -48
package/README.md CHANGED
@@ -1,488 +1,582 @@
1
- # AIConductor CLI
2
-
3
- AIConductor 平台命令行工具箱,提供内容选题简报、网页发布、搜索、抖音数据和小红书工具。
4
-
5
- ## 安装
6
-
7
- ```bash
8
- npm install -g aiconductor-cli
9
- ```
10
-
11
- **Node.js >= 18.0.0** 环境。
12
-
13
- ## 配置 API Key
14
-
15
- 前往 [https://dev.aiconductor.fun/register](https://dev.aiconductor.fun/register) 注册获取 API Key,然后配置环境变量:
16
-
17
- **macOS / Linux:**
18
- ```bash
19
- echo 'export AICONDUCTOR_API_KEY="your-api-key"' >> ~/.zshrc && source ~/.zshrc
20
- ```
21
-
22
- **Windows PowerShell:**
23
- ```powershell
24
- [Environment]::SetEnvironmentVariable("AICONDUCTOR_API_KEY", "your-api-key", "User")
25
- ```
26
-
27
- > 也可在项目目录创建 `.env` 文件写入 `AICONDUCTOR_API_KEY=your-api-key`。
28
-
29
- ## 命令
30
-
31
- ### 发布 HTML 网页
32
-
33
- ```bash
34
- aiconductor-cli html publish <HTML代码或文件路径> [选项]
35
- ```
36
-
37
- | 选项 | 说明 |
38
- |------|------|
39
- | `-t, --title` | 文档标题,用作文件名基础 |
40
- | `-k, --api-key` | API Key(可选,默认读取环境变量) |
41
- | `-f, --format` | 输出格式:`json`(默认)或 `text` |
42
-
43
- 示例:
44
- ```bash
45
- aiconductor-cli html publish index.html -t my-page
46
- aiconductor-cli html publish "<h1>Hello</h1>" -t hello-page -f text
47
- ```
48
-
49
- ### 发布 Markdown/HTML 网页(推荐)
50
-
51
- `webpage publish` 是统一的网页发布命令,自动识别 Markdown 和 HTML 并发布为在线网页。
52
-
53
- ```bash
54
- aiconductor-cli webpage publish <Markdown/HTML代码或文件路径> [选项]
55
- ```
56
-
57
- | 选项 | 说明 | 默认值 |
58
- |------|------|--------|
59
- | `-t, --title` | 文件名(不含 .html 后缀) | 自动生成 |
60
- | `-k, --api-key` | API Key(可选) | 环境变量 |
61
- | `--type` | 强制指定类型:`md` 或 `html` | 自动识别 |
62
- | `--copy-button` | 为代码块添加复制按钮(仅 Markdown) | 关闭 |
63
- | `-f, --format` | 输出格式:`json` 或 `text` | json |
64
-
65
- 示例:
66
- ```bash
67
- # 发布 Markdown 文件
68
- aiconductor-cli webpage publish README.md -t docs
69
-
70
- # 发布 Markdown 并添加代码复制按钮
71
- aiconductor-cli webpage publish article.md -t article --copy-button
72
-
73
- # 发布 HTML 文件
74
- aiconductor-cli webpage publish index.html -t my-page
75
-
76
- # 直接传入内容字符串
77
- aiconductor-cli webpage publish "# Hello\n\nThis is **markdown**" -t hello
78
- ```
79
-
80
- ### 管理已发布网页
81
-
82
- 查询当前 API Key 所属用户的网页发布记录:
83
-
84
- ```bash
85
- aiconductor-cli webpage list [选项]
86
- ```
87
-
88
- | 选项 | 说明 | 默认值 |
89
- |------|------|--------|
90
- | `--page` | 页码,最小为 1 | 1 |
91
- | `--page-size` | 每页条数,范围为 1 到 100 | 20 |
92
- | `-k, --api-key` | API Key(可选) | 环境变量 |
93
- | `-f, --format` | 输出格式:`json` 或 `text` | json |
94
-
95
- 删除指定的已发布网页及其公开 HTML 对象:
96
-
97
- ```bash
98
- aiconductor-cli webpage delete <webpage_id> [选项]
99
- ```
100
-
101
- 示例:
102
- ```bash
103
- # 查看第 2 页,每页 50 条
104
- aiconductor-cli webpage list --page 2 --page-size 50 -f text
105
-
106
- # 删除 ID 为 123 的网页
107
- aiconductor-cli webpage delete 123
108
- ```
109
-
110
- ### 网页搜索
111
-
112
- ```bash
113
- aiconductor-cli search web <关键词> [选项]
114
- ```
115
-
116
- | 选项 | 说明 | 默认值 |
117
- |------|------|--------|
118
- | `-n, --count` | 返回条数(最多50) | 10 |
119
- | `--time-range` | 时间范围:预设 `OneDay`/`OneWeek`/`OneMonth`/`OneYear`,或自定义 `YYYY-MM-DD..YYYY-MM-DD` | 无 |
120
- | `--need-content` | 仅返回包含正文的结果 | 关闭 |
121
- | `--need-url` | 仅返回带原文链接的结果 | 关闭 |
122
- | `--sites` | 限定搜索站点,完整域名以 `\|` 分隔,最多20个 | 无 |
123
- | `--block-hosts` | 屏蔽站点,完整域名以 `\|` 分隔,最多5个 | 无 |
124
- | `--auth-info-level` | 权威度过滤:0=不限制,1=仅非常权威内容 | 0 |
125
- | `--auth-level` | `--auth-info-level` 的兼容别名 | 无 |
126
- | `--content-format` | 正文格式:`text` 或 `markdown` | text |
127
- | `--industry` | 行业搜索:`finance`、`game` 或 `gov` | 无 |
128
- | `--query-rewrite` | 开启 Query 改写 | 关闭 |
129
- | `-f, --format` | 输出格式:`json` 或 `text` | json |
130
-
131
- 示例:
132
- ```bash
133
- aiconductor-cli search web "北京今日天气" -n 3 --auth-info-level 1 --need-url
134
- aiconductor-cli search web "AI 最新进展" --time-range OneWeek --content-format markdown --need-content
135
- aiconductor-cli search web "技术文章" --time-range 2025-01-01..2025-06-30 -n 10
136
- ```
137
-
138
- ### 图片搜索
139
-
140
- ```bash
141
- aiconductor-cli search image <关键词> [选项]
142
- ```
143
-
144
- | 选项 | 说明 | 默认值 |
145
- |------|------|--------|
146
- | `-n, --count` | 返回条数(最多5) | 5 |
147
- | `--image-width-min` | 图片最小宽度 | 无 |
148
- | `--image-width-max` | 图片最大宽度 | 无 |
149
- | `--image-height-min` | 图片最小高度 | 无 |
150
- | `--image-height-max` | 图片最大高度 | 无 |
151
- | `--image-shapes` | 图片形状,以 `\|` 分隔:`横长方形`、`竖长方形`、`方形` | 无 |
152
- | `--query-rewrite` | 开启 Query 改写 | 关闭 |
153
- | `-f, --format` | 输出格式:`json` 或 `text` | json |
154
-
155
- 示例:
156
- ```bash
157
- aiconductor-cli search image "长城风景" -n 3 --image-width-min 1200 --image-shapes "横长方形|方形" -f text
158
- ```
159
-
160
- ### 热点选题简报
161
-
162
- 聚合多个平台热点与小红书实时热榜,为内容选题提供带来源链接的原料。默认查询知乎、微博、抖音和 AIHOT,每个来源返回 30 条,并额外请求一次小红书热榜。
163
-
164
- ```bash
165
- aiconductor-cli content briefing [选项]
166
- ```
167
-
168
- | 选项 | 说明 | 默认值 |
169
- |------|------|--------|
170
- | `--sources <ids>` | 来源 ID,逗号分隔;例如 `zhihu,weibo,aihot` | `zhihu,weibo,douyin,aihot` |
171
- | `--limit <n>` | 每个来源返回条数,范围 1 到 30 | 30 |
172
- | `-k, --api-key <key>` | API Key(可选) | 环境变量 |
173
- | `-f, --format <format>` | 输出格式:`json` 或 `text` | json |
174
-
175
- 示例:
176
- ```bash
177
- # 默认综合热点简报
178
- aiconductor-cli content briefing -f text
179
-
180
- # 只查看技术与产品来源
181
- aiconductor-cli content briefing --sources aihot,hackernews,producthunt,juejin --limit 15 -f text
182
- ```
183
-
184
- 默认 JSON 输出保留以下字段,便于后续选题处理:
185
-
186
- - `data.data.sources`:成功的综合热榜来源,兼容旧版本。
187
- - `data.data.failed_sources`:综合热榜中失败的平台来源。
188
- - `data.data.xhs_hot_list`:小红书热榜结果,包含日期与话题条目;小红书热榜接口失败时为 `null`。
189
- - `data.data.failed_services`:综合热榜或小红书热榜接口级失败信息。
190
-
191
- 任一服务成功时命令仍会返回可用数据;只有两个服务都失败时才退出失败。成功来源和成功的小红书热榜调用均按平台现有规则计费。
192
-
193
- ### 抖音数据工具箱
194
-
195
- ```bash
196
- aiconductor-cli douyin <子命令> [参数] [选项]
197
- ```
198
-
199
- #### 获取作品详情
200
-
201
- ```bash
202
- aiconductor-cli douyin video-info <分享链接> [选项]
203
- ```
204
-
205
- 示例:
206
- ```bash
207
- aiconductor-cli douyin video-info "https://v.douyin.com/xxxxx/"
208
- ```
209
-
210
- #### 获取作品评论
211
-
212
- ```bash
213
- aiconductor-cli douyin video-comments <视频URL> [选项]
214
- ```
215
-
216
- | 选项 | 说明 | 默认值 |
217
- |------|------|--------|
218
- | `--max-count` | 获取评论数量 | 50 |
219
- | `-f, --format` | 输出格式 | json |
220
-
221
- 示例:
222
- ```bash
223
- aiconductor-cli douyin video-comments "https://www.douyin.com/video/xxxxx" --max-count 100
224
- ```
225
-
226
- #### 获取用户视频列表
227
-
228
- ```bash
229
- aiconductor-cli douyin user-videos <用户主页URL> [选项]
230
- ```
231
-
232
- | 选项 | 说明 | 默认值 |
233
- |------|------|--------|
234
- | `--max-pages` | 最大页数 | 1 |
235
- | `--max-seconds` | 最长运行时间(秒),最大 180 | 50 |
236
- | `-f, --format` | 输出格式 | json |
237
-
238
- 示例:
239
- ```bash
240
- aiconductor-cli douyin user-videos "https://www.douyin.com/user/xxxxx" --max-pages 3
241
- ```
242
-
243
- #### 获取用户详情
244
-
245
- ```bash
246
- aiconductor-cli douyin user-detail <用户主页URL> [选项]
247
- ```
248
-
249
- 示例:
250
- ```bash
251
- aiconductor-cli douyin user-detail "https://www.douyin.com/user/xxxxx"
252
- ```
253
-
254
- #### 搜索用户
255
-
256
- ```bash
257
- aiconductor-cli douyin user-search <关键词> [选项]
258
- ```
259
-
260
- | 选项 | 说明 | 默认值 |
261
- |------|------|--------|
262
- | `--max-pages` | 最大页数,0=不限制 | 1 |
263
- | `--max-seconds` | 最长运行时间(秒),最大 180 | 50 |
264
- | `--fans-range` | 粉丝数筛选:`0_1k`/`1k_1w`/`1w_10w`/`10w_100w`/`100w_` | 无 |
265
- | `--user-type` | 用户类型:`common_user`/`enterprise_user`/`personal_user` | 无 |
266
- | `-f, --format` | 输出格式 | json |
267
-
268
- 示例:
269
- ```bash
270
- aiconductor-cli douyin user-search "美食博主" --fans-range 10w_100w --user-type personal_user
271
- ```
272
-
273
- #### 搜索视频
274
-
275
- ```bash
276
- aiconductor-cli douyin video-search <关键词> [选项]
277
- ```
278
-
279
- | 选项 | 说明 | 默认值 |
280
- |------|------|--------|
281
- | `--max-pages` | 最大页数,0=不限制 | 1 |
282
- | `--max-seconds` | 最长运行时间(秒),最大 50 | 50 |
283
- | `--sort-type` | 排序:0=综合,1=最多点赞,2=最新发布 | 0 |
284
- | `--publish-time` | 发布时间:0=不限,1=一天,7=一周,180=半年 | 0 |
285
- | `--filter-duration` | 时长:0=不限,0-1=1分钟内,1-5=1-5分钟,5-10000=5分钟以上 | 0 |
286
- | `--content-type` | 内容类型:0=不限,1=视频,2=图片,3=文章 | 0 |
287
- | `-f, --format` | 输出格式 | json |
288
-
289
- 示例:
290
- ```bash
291
- aiconductor-cli douyin video-search "编程教程" --sort-type 2 --publish-time 7 --content-type 1
292
- ```
293
-
294
- #### 视频链接转文字
295
-
296
- ```bash
297
- aiconductor-cli douyin link-to-text <视频URL> [选项]
298
- ```
299
-
300
- 示例:
301
- ```bash
302
- aiconductor-cli douyin link-to-text "https://www.douyin.com/video/xxxxx"
303
- ```
304
-
305
- ### 小红书数据工具
306
-
307
- 获取小红书实时热榜:
308
-
309
- ```bash
310
- aiconductor-cli xhs hot-list [选项]
311
- ```
312
-
313
- 示例:
314
- ```bash
315
- aiconductor-cli xhs hot-list -f text
316
- ```
317
-
318
- #### 笔记详情 `xhs note`
319
-
320
- ```bash
321
- aiconductor-cli xhs note <ref> [选项]
322
- ```
323
-
324
- `ref` 支持笔记链接、`xhslink.cn`/`xhslink.com` 短链、完整分享口令,或 24 位 `note_id`。
325
-
326
- ```bash
327
- aiconductor-cli xhs note "https://www.xiaohongshu.com/discovery/item/6ae972260000000015020d84" -f text
328
- aiconductor-cli xhs note "标题 https://xhslink.cn/o/85lbqBJtO94 复制内容,然后进入【小红书】查看相关笔记。"
329
- ```
330
-
331
- #### 笔记评论 `xhs comments`
332
-
333
- ```bash
334
- aiconductor-cli xhs comments <ref> [选项]
335
- ```
336
-
337
- | 选项 | 说明 | 默认值 |
338
- |------|------|--------|
339
- | `--max-pages <n>` | 最大翻页数,范围 1~5 | 1 |
340
- | `--max-seconds <n>` | 最长运行时间(秒),上限 170 | 50 |
341
-
342
- 返回一级评论,并带上上游可见的楼内回复(`sub_comments`)。`data.data.comments[]` 里 `like_count`、`sub_comment_count` 是**字符串**,评论的 `user` 对象用 `userid`/`original_name`(与笔记的 `user_id`/`nickname` 不同)。
343
-
344
- #### 笔记搜索 `xhs search`
345
-
346
- ```bash
347
- aiconductor-cli xhs search <keyword> [选项]
348
- ```
349
-
350
- | 选项 | 说明 | 默认值 |
351
- |------|------|--------|
352
- | `--sort <sort>` | `general` / `time_descending` / `popularity_descending` / `comment_descending` / `collect_descending` | 不限 |
353
- | `--note-time <range>` | `day` / `week` / `halfyear` | 不限 |
354
- | `--note-type <type>` | `video` / `note` | 不限 |
355
- | `--max-pages <n>` | 最大翻页数,范围 1~5 | 1 |
356
-
357
- 示例:
358
- ```bash
359
- aiconductor-cli xhs search "AI编程" --note-time week --sort popularity_descending --max-pages 2 -f text
360
- ```
361
-
362
- 结果在 `data.data.items[].noteInfo` 与 `.userInfo`。注意 `noteInfo.readNum` 与 `userInfo.fansNum` 实测恒为 0,不要当真实阅读量/粉丝数用。
363
-
364
- #### 用户详情 `xhs user` / 用户笔记 `xhs user-notes`
365
-
366
- ```bash
367
- aiconductor-cli xhs user <ref> [选项]
368
- aiconductor-cli xhs user-notes <ref> [选项] # 支持 --max-pages,范围 1~5
369
- ```
370
-
371
- `ref` 支持主页链接 `/user/profile/<id>` 或 24 位 `user_id`。
372
-
373
- ```bash
374
- aiconductor-cli xhs user "https://www.xiaohongshu.com/user/profile/53cd3bbbb4c4d64f93463018" -f text
375
- aiconductor-cli xhs user-notes 53cd3bbbb4c4d64f93463018 --max-pages 2 -f text
376
- ```
377
-
378
- 用户详情在 `user_info`(`basic_info` + 5 项中文 `interactions` + `tags`);用户笔记在 `data.data.notes[]`。
379
-
380
- > 时间口径:小红书所有 `time` 都是 **UTC 时间戳**(笔记详情为秒、用户笔记为毫秒),`-f text` 已自动换算成北京时间;**不要**再额外加 8 小时。上游的 `time_desc`(如 `10-28`)是 UTC-8 口径,文本模式不使用它。
381
-
382
- ### 小红书扫码发布
383
-
384
- 生成图文或视频笔记的 H5 发布页与二维码。素材支持公网 URL、本地文件、Base64/data URL,以及包含 Base64 内容的文本文件。
385
-
386
- ```bash
387
- # 图文:URL 与本地图片混用
388
- aiconductor-cli xhs note-publish normal \
389
- --title "笔记标题" \
390
- --images "https://example.com/photo1.jpg" \
391
- --image-file "./photo2.jpg" \
392
- --image-file "./photo3.png"
393
-
394
- # 图文:较大 Base64 写入文本文件后使用 @路径
395
- aiconductor-cli xhs note-publish normal \
396
- --image-base64 "@./photo-base64.txt"
397
-
398
- # 视频:本地视频与本地封面
399
- aiconductor-cli xhs note-publish video \
400
- --title "视频标题" \
401
- --video-file "./video.mp4" \
402
- --cover-file "./cover.jpg"
403
- ```
404
-
405
- | 选项 | 说明 | 默认值 |
406
- |------|------|--------|
407
- | `--images <urls>` | 图片 URL 列表,逗号分隔 | 无 |
408
- | `--image-file <path>` | 本地图片路径,可重复使用 | 无 |
409
- | `--image-base64 <data>` | 图片 Base64、data URL 或 `@文本文件`,可重复使用 | 无 |
410
- | `--video <url>` | 视频 URL | 无 |
411
- | `--video-file <path>` | 本地视频路径 | 无 |
412
- | `--video-base64 <data>` | 视频 Base64、data URL 或 `@文本文件` | 无 |
413
- | `--cover <url>` | 视频封面 URL | 无 |
414
- | `--cover-file <path>` | 本地视频封面路径 | 无 |
415
- | `--cover-base64 <data>` | 封面 Base64、data URL 或 `@文本文件` | 无 |
416
- | `--upload-valid-days <days>` | 本地/Base64 素材临时链接有效期:1 或 7 天 | 7 |
417
-
418
- 本地文件会在 CLI 内转换成 data URL,与 Base64 素材统一通过 JSON 接口免费上传为临时公开 URL,不使用 multipart。图片合计最多 18 张、单张最多 32MB;本地/Base64 视频受上传接口限制为 100MB,URL 视频上限为 200MB。
419
-
420
- ### 微信公众号数据工具
421
-
422
- 两个子命令:取单篇文章的互动数据、取公众号历史文章列表。
423
-
424
- ```bash
425
- # 单篇文章互动数据(阅读 / 点赞 / 在看 等)
426
- aiconductor-cli wx article-data "https://mp.weixin.qq.com/s?__biz=xxxx&mid=xxxx&idx=1&sn=xxxx"
427
-
428
- # 公众号历史文章列表:用公众号名称或任意一篇文章链接定位
429
- aiconductor-cli wx history --name "人民日报" --max-pages 3 --max-seconds 50
430
- aiconductor-cli wx history "https://mp.weixin.qq.com/s?__biz=xxxx" -f text
431
- ```
432
-
433
- | 选项 | 适用命令 | 说明 | 默认值 |
434
- |------|----------|------|--------|
435
- | `--name <name>` | `history` | 公众号名称或微信 ID(与 `url` 至少提供一个) | 无 |
436
- | `--max-pages <n>` | `history` | 最大翻页数量 | 1 |
437
- | `--max-seconds <n>` | `history` | 最长运行时间(秒),上限 170 | 50 |
438
-
439
- 返回路径:`article-data` 的互动数据在 `data.data`(`read` / `zan` / `looking` / `share_num` / `collect_num` / `comment_count`,text 模式渲染成阅读/点赞/在看/分享/收藏/评论,未知字段原样输出);`history` 的文章在 `data.data.data[]`(标题 `title`、时间 `post_time_str`、阅读 `read`、点赞 `zan`、链接 `url`)。
440
-
441
- `history` 另带 `data.data.code`(上游返回码):`0` 才表示成功;非 0(如 `107` 名称/链接对不上、`20001` 平台侧上游故障)时 CLI 以退出码 1 报 `api_error`,不会用空列表冒充成功。
442
-
443
- ### 通用选项
444
-
445
- 所有命令支持:
446
- - `-k, --api-key <key>` — API Key(优先级:参数 > 环境变量 > .env 文件)
447
- - `-f, --format <json|text>` — 输出格式,默认 JSON
448
-
449
- ## 计费
450
-
451
- | 功能 | 价格 |
452
- |------|------|
453
- | HTML 发布 | 0.01 元/次 |
454
- | Markdown/HTML 网页发布 | 0.01 元/次 |
455
- | 豆包网页/图片搜索 | 0.02 元/次 |
456
- | 抖音作品详情 | 0.01 元/次 |
457
- | 抖音作品评论 | 0.01 元/次 |
458
- | 抖音用户视频列表 | 0.03 元/页 |
459
- | 抖音用户详情 | 0.03 元/次 |
460
- | 抖音用户搜索 | 0.15 元/页 |
461
- | 抖音视频搜索 | 0.15 元/页 |
462
- | 抖音链接转文字 | 0.01 元/次 + 0.0003 元/秒 |
463
- | 小红书热榜 | 以平台服务配置为准 |
464
- | 小红书笔记详情 | 以平台服务配置为准(按次) |
465
- | 小红书笔记评论 | 以平台服务配置为准(按成功翻页数) |
466
- | 小红书笔记搜索 | 以平台服务配置为准(按成功翻页数) |
467
- | 小红书用户详情 | 以平台服务配置为准(按次) |
468
- | 小红书用户笔记列表 | 以平台服务配置为准(按成功翻页数) |
469
- | 小红书扫码发布 | 0.05 元/次 |
470
- | 公众号文章互动数据 | 以平台服务配置为准(按次) |
471
- | 公众号历史文章列表 | 以平台服务配置为准(按成功翻页数) |
472
-
473
- > 搜索/调用失败不扣费,仅成功时计费。
474
-
475
- ## 开发
476
-
477
- ```bash
478
- git clone https://github.com/huyi9531/aiconductor-cli.git
479
- cd aiconductor-cli
480
- npm install
481
- node bin/aiconductor-cli.js --help # 本地运行
482
- ```
483
-
484
- 贡献前请阅读 [AGENTS.md](./AGENTS.md) 了解项目结构、编码风格与提交流程。
485
-
486
- ## License
487
-
488
- MIT
1
+ # AIConductor CLI
2
+
3
+ AIConductor 平台命令行工具箱,提供内容选题简报、网页发布、搜索、抖音数据和小红书工具。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install -g aiconductor-cli
9
+ ```
10
+
11
+ **Node.js >= 18.0.0** 环境。
12
+
13
+ ## 配置 API Key
14
+
15
+ 前往 [https://dev.aiconductor.fun/register](https://dev.aiconductor.fun/register) 注册获取 API Key,然后配置环境变量:
16
+
17
+ **macOS / Linux:**
18
+ ```bash
19
+ echo 'export AICONDUCTOR_API_KEY="your-api-key"' >> ~/.zshrc && source ~/.zshrc
20
+ ```
21
+
22
+ **Windows PowerShell:**
23
+ ```powershell
24
+ [Environment]::SetEnvironmentVariable("AICONDUCTOR_API_KEY", "your-api-key", "User")
25
+ ```
26
+
27
+ > 也可在项目目录创建 `.env` 文件写入 `AICONDUCTOR_API_KEY=your-api-key`。
28
+
29
+ ## 命令
30
+
31
+ ### 发布 HTML 网页
32
+
33
+ ```bash
34
+ aiconductor-cli html publish <HTML代码或文件路径> [选项]
35
+ ```
36
+
37
+ | 选项 | 说明 |
38
+ |------|------|
39
+ | `-t, --title` | 文档标题,用作文件名基础 |
40
+ | `-k, --api-key` | API Key(可选,默认读取环境变量) |
41
+ | `-f, --format` | 输出格式:`json`(默认)或 `text` |
42
+
43
+ 示例:
44
+ ```bash
45
+ aiconductor-cli html publish index.html -t my-page
46
+ aiconductor-cli html publish "<h1>Hello</h1>" -t hello-page -f text
47
+ ```
48
+
49
+ ### 发布 Markdown/HTML 网页(推荐)
50
+
51
+ `webpage publish` 是统一的网页发布命令,自动识别 Markdown 和 HTML 并发布为在线网页。
52
+
53
+ ```bash
54
+ aiconductor-cli webpage publish <Markdown/HTML代码或文件路径> [选项]
55
+ ```
56
+
57
+ | 选项 | 说明 | 默认值 |
58
+ |------|------|--------|
59
+ | `-t, --title` | 文件名(不含 .html 后缀) | 自动生成 |
60
+ | `-k, --api-key` | API Key(可选) | 环境变量 |
61
+ | `--type` | 强制指定类型:`md` 或 `html` | 自动识别 |
62
+ | `--copy-button` | 为代码块添加复制按钮(仅 Markdown) | 关闭 |
63
+ | `-f, --format` | 输出格式:`json` 或 `text` | json |
64
+
65
+ 示例:
66
+ ```bash
67
+ # 发布 Markdown 文件
68
+ aiconductor-cli webpage publish README.md -t docs
69
+
70
+ # 发布 Markdown 并添加代码复制按钮
71
+ aiconductor-cli webpage publish article.md -t article --copy-button
72
+
73
+ # 发布 HTML 文件
74
+ aiconductor-cli webpage publish index.html -t my-page
75
+
76
+ # 直接传入内容字符串
77
+ aiconductor-cli webpage publish "# Hello\n\nThis is **markdown**" -t hello
78
+ ```
79
+
80
+ ### 管理已发布网页
81
+
82
+ 查询当前 API Key 所属用户的网页发布记录:
83
+
84
+ ```bash
85
+ aiconductor-cli webpage list [选项]
86
+ ```
87
+
88
+ | 选项 | 说明 | 默认值 |
89
+ |------|------|--------|
90
+ | `--page` | 页码,最小为 1 | 1 |
91
+ | `--page-size` | 每页条数,范围为 1 到 100 | 20 |
92
+ | `-k, --api-key` | API Key(可选) | 环境变量 |
93
+ | `-f, --format` | 输出格式:`json` 或 `text` | json |
94
+
95
+ 删除指定的已发布网页及其公开 HTML 对象:
96
+
97
+ ```bash
98
+ aiconductor-cli webpage delete <webpage_id> [选项]
99
+ ```
100
+
101
+ 示例:
102
+ ```bash
103
+ # 查看第 2 页,每页 50 条
104
+ aiconductor-cli webpage list --page 2 --page-size 50 -f text
105
+
106
+ # 删除 ID 为 123 的网页
107
+ aiconductor-cli webpage delete 123
108
+ ```
109
+
110
+ ### 网页搜索
111
+
112
+ ```bash
113
+ aiconductor-cli search web <关键词> [选项]
114
+ ```
115
+
116
+ | 选项 | 说明 | 默认值 |
117
+ |------|------|--------|
118
+ | `-n, --count` | 返回条数(最多50) | 10 |
119
+ | `--time-range` | 时间范围:预设 `OneDay`/`OneWeek`/`OneMonth`/`OneYear`,或自定义 `YYYY-MM-DD..YYYY-MM-DD` | 无 |
120
+ | `--need-content` | 仅返回包含正文的结果 | 关闭 |
121
+ | `--need-url` | 仅返回带原文链接的结果 | 关闭 |
122
+ | `--sites` | 限定搜索站点,完整域名以 `\|` 分隔,最多20个 | 无 |
123
+ | `--block-hosts` | 屏蔽站点,完整域名以 `\|` 分隔,最多5个 | 无 |
124
+ | `--auth-info-level` | 权威度过滤:0=不限制,1=仅非常权威内容 | 0 |
125
+ | `--auth-level` | `--auth-info-level` 的兼容别名 | 无 |
126
+ | `--content-format` | 正文格式:`text` 或 `markdown` | text |
127
+ | `--industry` | 行业搜索:`finance`、`game` 或 `gov` | 无 |
128
+ | `--query-rewrite` | 开启 Query 改写 | 关闭 |
129
+ | `-f, --format` | 输出格式:`json` 或 `text` | json |
130
+
131
+ 示例:
132
+ ```bash
133
+ aiconductor-cli search web "北京今日天气" -n 3 --auth-info-level 1 --need-url
134
+ aiconductor-cli search web "AI 最新进展" --time-range OneWeek --content-format markdown --need-content
135
+ aiconductor-cli search web "技术文章" --time-range 2025-01-01..2025-06-30 -n 10
136
+ ```
137
+
138
+ ### 图片搜索
139
+
140
+ ```bash
141
+ aiconductor-cli search image <关键词> [选项]
142
+ ```
143
+
144
+ | 选项 | 说明 | 默认值 |
145
+ |------|------|--------|
146
+ | `-n, --count` | 返回条数(最多5) | 5 |
147
+ | `--image-width-min` | 图片最小宽度 | 无 |
148
+ | `--image-width-max` | 图片最大宽度 | 无 |
149
+ | `--image-height-min` | 图片最小高度 | 无 |
150
+ | `--image-height-max` | 图片最大高度 | 无 |
151
+ | `--image-shapes` | 图片形状,以 `\|` 分隔:`横长方形`、`竖长方形`、`方形` | 无 |
152
+ | `--query-rewrite` | 开启 Query 改写 | 关闭 |
153
+ | `-f, --format` | 输出格式:`json` 或 `text` | json |
154
+
155
+ 示例:
156
+ ```bash
157
+ aiconductor-cli search image "长城风景" -n 3 --image-width-min 1200 --image-shapes "横长方形|方形" -f text
158
+ ```
159
+
160
+ ### 热点选题简报
161
+
162
+ 聚合多个平台热点与小红书实时热榜,为内容选题提供带来源链接的原料。默认查询知乎、微博、抖音和 AIHOT,每个来源返回 30 条,并额外请求一次小红书热榜。
163
+
164
+ ```bash
165
+ aiconductor-cli content briefing [选项]
166
+ ```
167
+
168
+ | 选项 | 说明 | 默认值 |
169
+ |------|------|--------|
170
+ | `--sources <ids>` | 来源 ID,逗号分隔;例如 `zhihu,weibo,aihot` | `zhihu,weibo,douyin,aihot` |
171
+ | `--limit <n>` | 每个来源返回条数,范围 1 到 30 | 30 |
172
+ | `-k, --api-key <key>` | API Key(可选) | 环境变量 |
173
+ | `-f, --format <format>` | 输出格式:`json` 或 `text` | json |
174
+
175
+ 示例:
176
+ ```bash
177
+ # 默认综合热点简报
178
+ aiconductor-cli content briefing -f text
179
+
180
+ # 只查看技术与产品来源
181
+ aiconductor-cli content briefing --sources aihot,hackernews,producthunt,juejin --limit 15 -f text
182
+ ```
183
+
184
+ 默认 JSON 输出保留以下字段,便于后续选题处理:
185
+
186
+ - `data.data.sources`:成功的综合热榜来源,兼容旧版本。
187
+ - `data.data.failed_sources`:综合热榜中失败的平台来源。
188
+ - `data.data.xhs_hot_list`:小红书热榜结果,包含日期与话题条目;小红书热榜接口失败时为 `null`。
189
+ - `data.data.failed_services`:综合热榜或小红书热榜接口级失败信息。
190
+
191
+ 任一服务成功时命令仍会返回可用数据;只有两个服务都失败时才退出失败。成功来源和成功的小红书热榜调用均按平台现有规则计费。
192
+
193
+ ### 抖音数据工具箱
194
+
195
+ ```bash
196
+ aiconductor-cli douyin <子命令> [参数] [选项]
197
+ ```
198
+
199
+ #### 获取作品详情
200
+
201
+ ```bash
202
+ aiconductor-cli douyin video-info <分享链接> [选项]
203
+ ```
204
+
205
+ 示例:
206
+ ```bash
207
+ aiconductor-cli douyin video-info "https://v.douyin.com/xxxxx/"
208
+ ```
209
+
210
+ #### 获取作品评论
211
+
212
+ ```bash
213
+ aiconductor-cli douyin video-comments <视频URL> [选项]
214
+ ```
215
+
216
+ | 选项 | 说明 | 默认值 |
217
+ |------|------|--------|
218
+ | `--max-count` | 获取评论数量 | 50 |
219
+ | `-f, --format` | 输出格式 | json |
220
+
221
+ 示例:
222
+ ```bash
223
+ aiconductor-cli douyin video-comments "https://www.douyin.com/video/xxxxx" --max-count 100
224
+ ```
225
+
226
+ #### 获取用户视频列表
227
+
228
+ ```bash
229
+ aiconductor-cli douyin user-videos <用户主页URL> [选项]
230
+ ```
231
+
232
+ | 选项 | 说明 | 默认值 |
233
+ |------|------|--------|
234
+ | `--max-pages` | 最大页数 | 1 |
235
+ | `--max-seconds` | 最长运行时间(秒),最大 180 | 50 |
236
+ | `-f, --format` | 输出格式 | json |
237
+
238
+ 示例:
239
+ ```bash
240
+ aiconductor-cli douyin user-videos "https://www.douyin.com/user/xxxxx" --max-pages 3
241
+ ```
242
+
243
+ #### 获取用户详情
244
+
245
+ ```bash
246
+ aiconductor-cli douyin user-detail <用户主页URL> [选项]
247
+ ```
248
+
249
+ 示例:
250
+ ```bash
251
+ aiconductor-cli douyin user-detail "https://www.douyin.com/user/xxxxx"
252
+ ```
253
+
254
+ #### 搜索用户
255
+
256
+ ```bash
257
+ aiconductor-cli douyin user-search <关键词> [选项]
258
+ ```
259
+
260
+ | 选项 | 说明 | 默认值 |
261
+ |------|------|--------|
262
+ | `--max-pages` | 最大页数,0=不限制 | 1 |
263
+ | `--max-seconds` | 最长运行时间(秒),最大 180 | 50 |
264
+ | `--fans-range` | 粉丝数筛选:`0_1k`/`1k_1w`/`1w_10w`/`10w_100w`/`100w_` | 无 |
265
+ | `--user-type` | 用户类型:`common_user`/`enterprise_user`/`personal_user` | 无 |
266
+ | `-f, --format` | 输出格式 | json |
267
+
268
+ 示例:
269
+ ```bash
270
+ aiconductor-cli douyin user-search "美食博主" --fans-range 10w_100w --user-type personal_user
271
+ ```
272
+
273
+ #### 搜索视频
274
+
275
+ ```bash
276
+ aiconductor-cli douyin video-search <关键词> [选项]
277
+ ```
278
+
279
+ | 选项 | 说明 | 默认值 |
280
+ |------|------|--------|
281
+ | `--max-pages` | 最大页数,0=不限制 | 1 |
282
+ | `--max-seconds` | 最长运行时间(秒),最大 50 | 50 |
283
+ | `--sort-type` | 排序:0=综合,1=最多点赞,2=最新发布 | 0 |
284
+ | `--publish-time` | 发布时间:0=不限,1=一天,7=一周,180=半年 | 0 |
285
+ | `--filter-duration` | 时长:0=不限,0-1=1分钟内,1-5=1-5分钟,5-10000=5分钟以上 | 0 |
286
+ | `--content-type` | 内容类型:0=不限,1=视频,2=图片,3=文章 | 0 |
287
+ | `-f, --format` | 输出格式 | json |
288
+
289
+ 示例:
290
+ ```bash
291
+ aiconductor-cli douyin video-search "编程教程" --sort-type 2 --publish-time 7 --content-type 1
292
+ ```
293
+
294
+ #### 视频链接转文字
295
+
296
+ ```bash
297
+ aiconductor-cli douyin link-to-text <视频URL> [选项]
298
+ ```
299
+
300
+ 示例:
301
+ ```bash
302
+ aiconductor-cli douyin link-to-text "https://www.douyin.com/video/xxxxx"
303
+ ```
304
+
305
+ #### 视频下载(普通清晰度)
306
+
307
+ ```bash
308
+ aiconductor-cli douyin download <视频URL|分享文案|作品ID> [选项]
309
+ ```
310
+
311
+ 一次返回多档媒体直链(通常 4 条:`hd_no_watermark` / `no_watermark` / `watermark` / `audio`),带高清无水印、普通无水印、带水印与纯音频,各自带清晰度标签与文件大小。
312
+
313
+ ```bash
314
+ aiconductor-cli douyin download "https://www.douyin.com/video/7696718696647036223" -f text
315
+ aiconductor-cli douyin download "https://v.douyin.com/xxxxx/"
316
+ ```
317
+
318
+ 返回路径:`data.medias[]`(`url` / `quality` / `type` / `extension` / `data_size`,音频条目额外带 `duration` 秒),另有 `author` / `title` / `thumbnail` / `duration`。
319
+
320
+ > **备用方案不等于失败**:上游主链路失败时会走兜底,此时 `medias` 只剩 2 条(`No Watermark` + `Audio`)、`data_size` 为 0、`message` 含「(备用方案)」。
321
+
322
+ #### 原画下载
323
+
324
+ ```bash
325
+ aiconductor-cli douyin video-original <视频URL|分享文案|作品ID> [选项]
326
+ ```
327
+
328
+ 拿最高画质(原画)直链与文件大小,和普通清晰度的 `download` 是两个档位。
329
+
330
+ ```bash
331
+ aiconductor-cli douyin video-original "https://www.douyin.com/video/7669664934044795354" -f text
332
+ aiconductor-cli douyin video-original "https://v.douyin.com/xxxxx/"
333
+ ```
334
+
335
+ 返回路径:`data.data.url`(直链)/ `file_size` / `file_size_mb` / `content_type` / `video_id`。
336
+
337
+ > **直链有时效**(带签名的 CDN 地址,过期返回 403),拿到就下,不要当永久地址存。实测一条作品的原画是 219 MB,下载侧请自行限流。
338
+
339
+ #### 选题雷达
340
+
341
+ ```bash
342
+ aiconductor-cli douyin topic-radar [选项]
343
+ ```
344
+
345
+ 并行调用 `douyin_hot_words`(热词榜)、`douyin_hot_topics`(当前热点 + 飙升话题)、`douyin_rising_topics`(飙升热点)三个原子接口并在本地合并——**任一段失败仍照常输出其余两段**,失败段写在 `data.failed_sources`。
346
+
347
+ ```bash
348
+ aiconductor-cli douyin topic-radar -f text
349
+ aiconductor-cli douyin topic-radar --limit 5
350
+ ```
351
+
352
+ | 选项 | 说明 | 默认值 |
353
+ |------|------|--------|
354
+ | `-n, --limit <n>` | 飙升榜条数(1~20) | 10 |
355
+
356
+ 返回路径:`data.data.hot_words`(`keyword` / `hot_index` / `trend_label`)、`data.data.hot_topics` 与 `data.data.rocketing_topics`(`topic_name` / `category` / `vv` / `content_cnt`)、`data.data.rising`(`sentence` / `hot_score` / `trend[]`)、`data.data.failed_sources`。
357
+
358
+ 计费:三个原子接口各自按次计费(全成功合计 ¥0.15),CLI 不额外收费、也不打折。
359
+
360
+ ### 小红书数据工具
361
+
362
+ 获取小红书实时热榜:
363
+
364
+ ```bash
365
+ aiconductor-cli xhs hot-list [选项]
366
+ ```
367
+
368
+ 示例:
369
+ ```bash
370
+ aiconductor-cli xhs hot-list -f text
371
+ ```
372
+
373
+ #### 笔记详情 `xhs note`
374
+
375
+ ```bash
376
+ aiconductor-cli xhs note <ref> [选项]
377
+ ```
378
+
379
+ `ref` 支持笔记链接、`xhslink.cn`/`xhslink.com` 短链、完整分享口令,或 24 位 `note_id`。
380
+
381
+ ```bash
382
+ aiconductor-cli xhs note "https://www.xiaohongshu.com/discovery/item/6ae972260000000015020d84" -f text
383
+ aiconductor-cli xhs note "标题 https://xhslink.cn/o/85lbqBJtO94 复制内容,然后进入【小红书】查看相关笔记。"
384
+ ```
385
+
386
+ #### 笔记评论 `xhs comments`
387
+
388
+ ```bash
389
+ aiconductor-cli xhs comments <ref> [选项]
390
+ ```
391
+
392
+ | 选项 | 说明 | 默认值 |
393
+ |------|------|--------|
394
+ | `--max-pages <n>` | 最大翻页数,范围 1~5 | 1 |
395
+ | `--max-seconds <n>` | 最长运行时间(秒),上限 170 | 50 |
396
+
397
+ 返回一级评论,并带上上游可见的楼内回复(`sub_comments`)。`data.data.comments[]` 里 `like_count`、`sub_comment_count` 是**字符串**,评论的 `user` 对象用 `userid`/`original_name`(与笔记的 `user_id`/`nickname` 不同)。
398
+
399
+ #### 笔记搜索 `xhs search`
400
+
401
+ ```bash
402
+ aiconductor-cli xhs search <keyword> [选项]
403
+ ```
404
+
405
+ | 选项 | 说明 | 默认值 |
406
+ |------|------|--------|
407
+ | `--sort <sort>` | `general` / `time_descending` / `popularity_descending` / `comment_descending` / `collect_descending` | 不限 |
408
+ | `--note-time <range>` | `day` / `week` / `halfyear` | 不限 |
409
+ | `--note-type <type>` | `video` / `note` | 不限 |
410
+ | `--max-pages <n>` | 最大翻页数,范围 1~5 | 1 |
411
+
412
+ 示例:
413
+ ```bash
414
+ aiconductor-cli xhs search "AI编程" --note-time week --sort popularity_descending --max-pages 2 -f text
415
+ ```
416
+
417
+ 结果在 `data.data.items[].noteInfo` 与 `.userInfo`。注意 `noteInfo.readNum` 与 `userInfo.fansNum` 实测恒为 0,不要当真实阅读量/粉丝数用。
418
+
419
+ #### 用户详情 `xhs user` / 用户笔记 `xhs user-notes`
420
+
421
+ ```bash
422
+ aiconductor-cli xhs user <ref> [选项]
423
+ aiconductor-cli xhs user-notes <ref> [选项] # 支持 --max-pages,范围 1~5
424
+ ```
425
+
426
+ `ref` 支持主页链接 `/user/profile/<id>` 或 24 位 `user_id`。
427
+
428
+ ```bash
429
+ aiconductor-cli xhs user "https://www.xiaohongshu.com/user/profile/53cd3bbbb4c4d64f93463018" -f text
430
+ aiconductor-cli xhs user-notes 53cd3bbbb4c4d64f93463018 --max-pages 2 -f text
431
+ ```
432
+
433
+ 用户详情在 `user_info`(`basic_info` + 5 项中文 `interactions` + `tags`);用户笔记在 `data.data.notes[]`。
434
+
435
+ > 时间口径:小红书所有 `time` 都是 **UTC 时间戳**(笔记详情为秒、用户笔记为毫秒),`-f text` 已自动换算成北京时间;**不要**再额外加 8 小时。上游的 `time_desc`(如 `10-28`)是 UTC-8 口径,文本模式不使用它。
436
+
437
+ ### 小红书达人报告(蒲公英)
438
+
439
+ 一次调用拿到达人的基础资料、粉丝画像与笔记性价比,并本地打分。内部是 **3 个原子接口并行调用**(`xhs_pgy_blogger` / `xhs_pgy_audience` / `xhs_pgy_performance`),至少两段成功才输出报告。
440
+
441
+ ```bash
442
+ aiconductor-cli xhs daren-report <user_id 或 主页链接> [-f json|text]
443
+ ```
444
+
445
+ 示例:
446
+
447
+ ```bash
448
+ aiconductor-cli xhs daren-report 5c5f8f4c000000001801612c -f text
449
+ aiconductor-cli xhs daren-report "https://www.xiaohongshu.com/user/profile/5c5f8f4c000000001801612c"
450
+ ```
451
+
452
+ 返回路径:`data.data.profile`(`name` / `red_id` / `fans_count` / `like_collect_count` / `business_note_count`)、`data.data.audience`(`gender` / `ages` / `interests`,**占比是 0~1 小数**)、`data.data.performance`(`hundred_like_percent` / `imp_median` / `interaction_rate` 等,**已是百分数**)、`data.data.score`(`value` / `tier` / `basis`)、`data.data.failed_sources`。
453
+
454
+ **打分公式**(纯规则,可自行复算):粉丝 40 分(≥10万=40、≥5万=34、≥1万=26、≥5千=18、≥1千=10、其余=4)+ 互动率 30 分(≥20%=30、≥10%=24、≥5%=16、≥2%=8)+ 百赞率 30 分(≥50=30、≥20=24、≥10=16、≥5=8);`≥80` 头部、`≥55` 腰部、其余尾部。任一段取数失败时按已拿到维度的满分之和归一,并标 `partial: true`。
455
+
456
+ 计费:三个原子接口各自按次计费(全成功合计 ¥0.90),CLI 不额外收费。
457
+
458
+ ### 小红书扫码发布
459
+
460
+ 生成图文或视频笔记的 H5 发布页与二维码。素材支持公网 URL、本地文件、Base64/data URL,以及包含 Base64 内容的文本文件。
461
+
462
+ ```bash
463
+ # 图文:URL 与本地图片混用
464
+ aiconductor-cli xhs note-publish normal \
465
+ --title "笔记标题" \
466
+ --images "https://example.com/photo1.jpg" \
467
+ --image-file "./photo2.jpg" \
468
+ --image-file "./photo3.png"
469
+
470
+ # 图文:较大 Base64 写入文本文件后使用 @路径
471
+ aiconductor-cli xhs note-publish normal \
472
+ --image-base64 "@./photo-base64.txt"
473
+
474
+ # 视频:本地视频与本地封面
475
+ aiconductor-cli xhs note-publish video \
476
+ --title "视频标题" \
477
+ --video-file "./video.mp4" \
478
+ --cover-file "./cover.jpg"
479
+ ```
480
+
481
+ | 选项 | 说明 | 默认值 |
482
+ |------|------|--------|
483
+ | `--images <urls>` | 图片 URL 列表,逗号分隔 | 无 |
484
+ | `--image-file <path>` | 本地图片路径,可重复使用 | 无 |
485
+ | `--image-base64 <data>` | 图片 Base64、data URL 或 `@文本文件`,可重复使用 | 无 |
486
+ | `--video <url>` | 视频 URL | 无 |
487
+ | `--video-file <path>` | 本地视频路径 | 无 |
488
+ | `--video-base64 <data>` | 视频 Base64、data URL 或 `@文本文件` | 无 |
489
+ | `--cover <url>` | 视频封面 URL | 无 |
490
+ | `--cover-file <path>` | 本地视频封面路径 | 无 |
491
+ | `--cover-base64 <data>` | 封面 Base64、data URL 或 `@文本文件` | 无 |
492
+ | `--upload-valid-days <days>` | 本地/Base64 素材临时链接有效期:1 或 7 天 | 7 |
493
+
494
+ 本地文件会在 CLI 内转换成 data URL,与 Base64 素材统一通过 JSON 接口免费上传为临时公开 URL,不使用 multipart。图片合计最多 18 张、单张最多 32MB;本地/Base64 视频受上传接口限制为 100MB,URL 视频上限为 200MB。
495
+
496
+ ### 微信公众号数据工具
497
+
498
+ 两个子命令:取单篇文章的互动数据、取公众号历史文章列表。
499
+
500
+ ```bash
501
+ # 单篇文章互动数据(阅读 / 点赞 / 在看 等)
502
+ aiconductor-cli wx article-data "https://mp.weixin.qq.com/s?__biz=xxxx&mid=xxxx&idx=1&sn=xxxx"
503
+
504
+ # 公众号历史文章列表:用公众号名称或任意一篇文章链接定位
505
+ aiconductor-cli wx history --name "人民日报" --max-pages 3 --max-seconds 50
506
+ aiconductor-cli wx history "https://mp.weixin.qq.com/s?__biz=xxxx" -f text
507
+ ```
508
+
509
+ | 选项 | 适用命令 | 说明 | 默认值 |
510
+ |------|----------|------|--------|
511
+ | `--name <name>` | `history` | 公众号名称或微信 ID(与 `url` 至少提供一个) | 无 |
512
+ | `--max-pages <n>` | `history` | 最大翻页数量 | 1 |
513
+ | `--max-seconds <n>` | `history` | 最长运行时间(秒),上限 170 | 50 |
514
+
515
+ 返回路径:`article-data` 的互动数据在 `data.data`(`read` / `zan` / `looking` / `share_num` / `collect_num` / `comment_count`,text 模式渲染成阅读/点赞/在看/分享/收藏/评论,未知字段原样输出);`history` 的文章在 `data.data.data[]`(标题 `title`、时间 `post_time_str`、阅读 `read`、点赞 `zan`、链接 `url`)。
516
+
517
+ `history` 另带 `data.data.code`(上游返回码):`0` 才表示成功;非 0(如 `107` 名称/链接对不上、`20001` 平台侧上游故障)时 CLI 以退出码 1 报 `api_error`,不会用空列表冒充成功。
518
+
519
+ ### 网页转 Markdown
520
+
521
+ 把任意网页(包括微信公众号文章)转成干净的 Markdown,拿去给模型读、存档或二次排版。
522
+
523
+ ```bash
524
+ # 公众号文章正文(链接请保留 chksm 参数,否则微信只返回页面框架)
525
+ aiconductor-cli web to-md "https://mp.weixin.qq.com/s?__biz=xxxx&mid=xxxx&idx=1&sn=xxxx&chksm=xxxx" -f text
526
+
527
+ # 普通网页(-t 可调超时,默认 30 秒)
528
+ aiconductor-cli web to-md "https://example.com/article" --timeout 45
529
+ ```
530
+
531
+ | 选项 | 说明 | 默认值 |
532
+ |------|------|--------|
533
+ | `-t, --timeout <seconds>` | 请求下游的超时秒数 | 30 |
534
+
535
+ 返回路径:`data.markdown`(**在顶层,不在 `data.data` 下**)。结果开头带 frontmatter(`title` / `author` / `site` / `source` / `domain` / `word_count`)——**有 `title` 与 `word_count` 才是真取到正文**;公众号链接若被裁掉 `chksm`,只能抓到“赞 / 在看 / 小程序”这类壳文字,text 模式会直接给出提示。
536
+
537
+ ### 通用选项
538
+
539
+ 所有命令支持:
540
+ - `-k, --api-key <key>` — API Key(优先级:参数 > 环境变量 > .env 文件)
541
+ - `-f, --format <json|text>` — 输出格式,默认 JSON
542
+
543
+ ## 计费
544
+
545
+ | 功能 | 价格 |
546
+ |------|------|
547
+ | HTML 发布 | 0.01 元/次 |
548
+ | Markdown/HTML 网页发布 | 0.01 元/次 |
549
+ | 豆包网页/图片搜索 | 0.02 元/次 |
550
+ | 抖音作品详情 | 0.01 元/次 |
551
+ | 抖音作品评论 | 0.01 元/次 |
552
+ | 抖音用户视频列表 | 0.03 元/页 |
553
+ | 抖音用户详情 | 0.03 元/次 |
554
+ | 抖音用户搜索 | 0.15 元/页 |
555
+ | 抖音视频搜索 | 0.15 元/页 |
556
+ | 抖音链接转文字 | 0.01 元/次 + 0.0003 元/秒 |
557
+ | 小红书热榜 | 以平台服务配置为准 |
558
+ | 小红书笔记详情 | 以平台服务配置为准(按次) |
559
+ | 小红书笔记评论 | 以平台服务配置为准(按成功翻页数) |
560
+ | 小红书笔记搜索 | 以平台服务配置为准(按成功翻页数) |
561
+ | 小红书用户详情 | 以平台服务配置为准(按次) |
562
+ | 小红书用户笔记列表 | 以平台服务配置为准(按成功翻页数) |
563
+ | 小红书扫码发布 | 0.05 元/次 |
564
+ | 公众号文章互动数据 | 以平台服务配置为准(按次) |
565
+ | 公众号历史文章列表 | 以平台服务配置为准(按成功翻页数) |
566
+
567
+ > 搜索/调用失败不扣费,仅成功时计费。
568
+
569
+ ## 开发
570
+
571
+ ```bash
572
+ git clone https://github.com/huyi9531/aiconductor-cli.git
573
+ cd aiconductor-cli
574
+ npm install
575
+ node bin/aiconductor-cli.js --help # 本地运行
576
+ ```
577
+
578
+ 贡献前请阅读 [AGENTS.md](./AGENTS.md) 了解项目结构、编码风格与提交流程。
579
+
580
+ ## License
581
+
582
+ MIT