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.
- package/README.md +582 -488
- package/bin/aiconductor-cli.js +412 -351
- package/package.json +1 -1
- package/src/api.js +151 -3
- package/src/api.test.js +360 -4
- package/src/commands/content.js +184 -184
- package/src/commands/douyin.js +252 -0
- package/src/commands/html_publish.js +54 -54
- package/src/commands/md_publish.js +175 -175
- package/src/commands/web.js +69 -0
- package/src/commands/web_search.js +99 -99
- package/src/commands/wx.js +116 -116
- package/src/commands/xhs.js +763 -609
- package/src/lib/cli-utils.js +172 -172
- package/src/lib/daren-score.js +91 -0
- package/src/lib/daren-score.test.js +57 -0
- package/AGENTS.md +0 -193
- package/api_docs/aic_web_search.md +0 -84
- package/api_docs/audio_converter.md +0 -51
- package/api_docs/balance_query.md +0 -38
- package/api_docs/bing_search.md +0 -55
- package/api_docs/china_stock_data.md +0 -221
- package/api_docs/delete_published_webpage.md +0 -38
- package/api_docs/doubao_search.md +0 -80
- package/api_docs/douyin_link_to_text_v1.md +0 -50
- package/api_docs/douyin_link_to_text_v2.md +0 -50
- package/api_docs/douyin_user_detail.md +0 -65
- package/api_docs/douyin_user_search.md +0 -58
- package/api_docs/douyin_user_videos.md +0 -49
- package/api_docs/douyin_user_videos_async.md +0 -45
- package/api_docs/douyin_user_videos_async_query.md +0 -41
- package/api_docs/douyin_user_videos_max.md +0 -59
- package/api_docs/douyin_video_comments.md +0 -68
- package/api_docs/douyin_video_info.md +0 -70
- package/api_docs/douyin_video_search.md +0 -60
- package/api_docs/douyin_video_search_fast.md +0 -48
- package/api_docs/fast_ocr.md +0 -51
- package/api_docs/flow_article2podcast_creat.md +0 -41
- package/api_docs/flow_article2podcast_query.md +0 -41
- package/api_docs/flow_wx_history_articles.md +0 -45
- package/api_docs/generate_image.md +0 -68
- package/api_docs/get_duration.md +0 -37
- package/api_docs/hot_list_mixed.md +0 -122
- package/api_docs/html_publish.md +0 -50
- package/api_docs/html_publish_flexible.md +0 -65
- package/api_docs/image_resize.md +0 -58
- package/api_docs/image_to_permalink.md +0 -61
- package/api_docs/link_expander.md +0 -39
- package/api_docs/llm_proxy.md +0 -61
- package/api_docs/markitdown.md +0 -47
- package/api_docs/md_to_docx.md +0 -51
- package/api_docs/md_to_html.md +0 -53
- package/api_docs/md_to_mindmap.md +0 -52
- package/api_docs/md_to_pdf.md +0 -52
- package/api_docs/md_to_png.md +0 -53
- package/api_docs/md_to_txt.md +0 -51
- package/api_docs/md_to_wxhtml.md +0 -64
- package/api_docs/md_to_xhs.md +0 -87
- package/api_docs/md_to_xlsx.md +0 -52
- package/api_docs/portrait_enhancement.md +0 -69
- package/api_docs/published_webpages.md +0 -45
- package/api_docs/r2_uploader.md +0 -51
- package/api_docs/schedulerx_job_create.md +0 -56
- package/api_docs/transaction_query.md +0 -52
- package/api_docs/url_to_markdown.md +0 -50
- package/api_docs/video_download_url.md +0 -57
- package/api_docs/video_download_url_oss.md +0 -55
- package/api_docs/video_to_text.md +0 -48
- package/api_docs/video_to_text_v2.md +0 -49
- package/api_docs/volcengine_face_pretty.md +0 -55
- package/api_docs/volcengine_faceswap.md +0 -55
- package/api_docs/website_screenshot.md +0 -49
- package/api_docs/wx_access_token.md +0 -44
- package/api_docs/wx_article_analysis_data_push.md +0 -43
- package/api_docs/wx_article_data.md +0 -48
- package/api_docs/wx_article_style_rewrite.md +0 -45
- package/api_docs/wx_draft_add.md +0 -56
- package/api_docs/wx_draft_publish.md +0 -47
- package/api_docs/wx_history_articles.md +0 -89
- package/api_docs/wx_image_upload.md +0 -46
- package/api_docs/wx_md_to_html.md +0 -48
- package/api_docs/wx_rss_reader.md +0 -59
- package/api_docs/xhs_hot_list.md +0 -48
- package/api_docs/xhs_note_comments_fast.md +0 -54
- package/api_docs/xhs_note_info_v2.md +0 -45
- package/api_docs/xhs_note_info_v3.md +0 -69
- package/api_docs/xhs_note_publish.md +0 -54
- package/api_docs/xhs_note_search_v2.md +0 -73
- package/api_docs/xhs_note_search_v3.md +0 -54
- package/api_docs/xhs_user_info_v2.md +0 -61
- package/api_docs/xhs_user_notes_v2.md +0 -56
- package/api_docs/xhs_user_notes_v3.md +0 -48
package/bin/aiconductor-cli.js
CHANGED
|
@@ -1,351 +1,412 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { Command } = require("commander");
|
|
4
|
-
const { publishCommand } = require("../src/commands/html_publish");
|
|
5
|
-
const {
|
|
6
|
-
publishCommand: webpagePublishCommand,
|
|
7
|
-
listCommand: webpageListCommand,
|
|
8
|
-
deleteCommand: webpageDeleteCommand,
|
|
9
|
-
} = require("../src/commands/md_publish");
|
|
10
|
-
const { searchCommand } = require("../src/commands/web_search");
|
|
11
|
-
const {
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.
|
|
74
|
-
.
|
|
75
|
-
.
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.
|
|
86
|
-
.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
93
|
-
.
|
|
94
|
-
.
|
|
95
|
-
.option("
|
|
96
|
-
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
97
|
-
.action((
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
.
|
|
108
|
-
.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.
|
|
114
|
-
.
|
|
115
|
-
.
|
|
116
|
-
.option("--
|
|
117
|
-
.option("
|
|
118
|
-
.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
searchCmd
|
|
128
|
-
.command("
|
|
129
|
-
.description("
|
|
130
|
-
.argument("<query>", "搜索关键词(1~100字符)")
|
|
131
|
-
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
132
|
-
.option("-n, --count <n>", "返回条数(最多
|
|
133
|
-
.option("--
|
|
134
|
-
.option("--
|
|
135
|
-
.option("--
|
|
136
|
-
.option("--
|
|
137
|
-
.option("--
|
|
138
|
-
.option("--
|
|
139
|
-
.option("-
|
|
140
|
-
.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
.
|
|
151
|
-
.
|
|
152
|
-
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
153
|
-
.option("--
|
|
154
|
-
.option("--
|
|
155
|
-
.option("-
|
|
156
|
-
.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.
|
|
172
|
-
.
|
|
173
|
-
.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.
|
|
177
|
-
.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
douyinCmd
|
|
185
|
-
.command("
|
|
186
|
-
.description("
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.
|
|
190
|
-
.
|
|
191
|
-
.
|
|
192
|
-
.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
.
|
|
199
|
-
.
|
|
200
|
-
.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
.
|
|
207
|
-
.
|
|
208
|
-
.
|
|
209
|
-
.option("--
|
|
210
|
-
.option("--
|
|
211
|
-
.option("-
|
|
212
|
-
.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
.
|
|
217
|
-
.
|
|
218
|
-
.
|
|
219
|
-
.option("--
|
|
220
|
-
.option("
|
|
221
|
-
.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
.
|
|
225
|
-
.
|
|
226
|
-
.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
.
|
|
230
|
-
.
|
|
231
|
-
.
|
|
232
|
-
.option("-
|
|
233
|
-
.
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
.
|
|
239
|
-
.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
.
|
|
243
|
-
.
|
|
244
|
-
.option("
|
|
245
|
-
.option("-
|
|
246
|
-
.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
.
|
|
251
|
-
.
|
|
252
|
-
.
|
|
253
|
-
.option("-
|
|
254
|
-
.option("--
|
|
255
|
-
.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
.
|
|
261
|
-
.
|
|
262
|
-
.
|
|
263
|
-
.option("--
|
|
264
|
-
.option("
|
|
265
|
-
.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
.
|
|
271
|
-
.
|
|
272
|
-
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
273
|
-
.option("-
|
|
274
|
-
.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
.
|
|
281
|
-
.
|
|
282
|
-
.
|
|
283
|
-
.option("-
|
|
284
|
-
.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
.
|
|
290
|
-
.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
.
|
|
294
|
-
.
|
|
295
|
-
.option("-
|
|
296
|
-
.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
.
|
|
301
|
-
.
|
|
302
|
-
.
|
|
303
|
-
.option("-
|
|
304
|
-
.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
.
|
|
308
|
-
.
|
|
309
|
-
.
|
|
310
|
-
.option("
|
|
311
|
-
.option("--
|
|
312
|
-
.option("
|
|
313
|
-
.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
.
|
|
322
|
-
.
|
|
323
|
-
.
|
|
324
|
-
.option("-
|
|
325
|
-
.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
.
|
|
330
|
-
.
|
|
331
|
-
.
|
|
332
|
-
.option("
|
|
333
|
-
.option("--
|
|
334
|
-
.option("
|
|
335
|
-
.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { Command } = require("commander");
|
|
4
|
+
const { publishCommand } = require("../src/commands/html_publish");
|
|
5
|
+
const {
|
|
6
|
+
publishCommand: webpagePublishCommand,
|
|
7
|
+
listCommand: webpageListCommand,
|
|
8
|
+
deleteCommand: webpageDeleteCommand,
|
|
9
|
+
} = require("../src/commands/md_publish");
|
|
10
|
+
const { searchCommand } = require("../src/commands/web_search");
|
|
11
|
+
const { toMdCommand } = require("../src/commands/web");
|
|
12
|
+
const { briefingCommand } = require("../src/commands/content");
|
|
13
|
+
const {
|
|
14
|
+
videoInfoCommand,
|
|
15
|
+
videoCommentsCommand,
|
|
16
|
+
userVideosCommand,
|
|
17
|
+
userDetailCommand,
|
|
18
|
+
userSearchCommand,
|
|
19
|
+
videoSearchCommand,
|
|
20
|
+
linkToTextCommand,
|
|
21
|
+
topicRadarCommand,
|
|
22
|
+
videoOriginalCommand,
|
|
23
|
+
downloadCommand,
|
|
24
|
+
} = require("../src/commands/douyin");
|
|
25
|
+
const {
|
|
26
|
+
hotListCommand: xhsHotListCommand,
|
|
27
|
+
notePublishCommand,
|
|
28
|
+
noteCommand: xhsNoteCommand,
|
|
29
|
+
commentsCommand: xhsCommentsCommand,
|
|
30
|
+
searchCommand: xhsSearchCommand,
|
|
31
|
+
userCommand: xhsUserCommand,
|
|
32
|
+
userNotesCommand: xhsUserNotesCommand,
|
|
33
|
+
darenReportCommand: xhsDarenReportCommand,
|
|
34
|
+
} = require("../src/commands/xhs");
|
|
35
|
+
const {
|
|
36
|
+
articleDataCommand: wxArticleDataCommand,
|
|
37
|
+
historyCommand: wxHistoryCommand,
|
|
38
|
+
} = require("../src/commands/wx");
|
|
39
|
+
|
|
40
|
+
const program = new Command();
|
|
41
|
+
|
|
42
|
+
function collect(value, previous) {
|
|
43
|
+
return previous ? previous.concat([value]) : [value];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
program
|
|
47
|
+
.name("aiconductor-cli")
|
|
48
|
+
.description("AIConductor CLI 工具箱")
|
|
49
|
+
.version(require("../package.json").version);
|
|
50
|
+
|
|
51
|
+
// web 子命令组(网页 → Markdown)
|
|
52
|
+
const webCmd = program
|
|
53
|
+
.command("web")
|
|
54
|
+
.description("网页内容转换");
|
|
55
|
+
|
|
56
|
+
webCmd
|
|
57
|
+
.command("to-md")
|
|
58
|
+
.description("将任意网页(含微信公众号文章)转成干净的 Markdown")
|
|
59
|
+
.argument("<url>", "网页链接(须以 http:// 或 https:// 开头)")
|
|
60
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
61
|
+
.option("-t, --timeout <seconds>", "请求超时秒数(默认 30)")
|
|
62
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
63
|
+
.action((url, options) => {
|
|
64
|
+
toMdCommand(url, options);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// html 子命令组
|
|
68
|
+
const htmlCmd = program
|
|
69
|
+
.command("html")
|
|
70
|
+
.description("HTML 相关操作");
|
|
71
|
+
|
|
72
|
+
htmlCmd
|
|
73
|
+
.command("publish")
|
|
74
|
+
.description("发布 HTML 代码为在线网页")
|
|
75
|
+
.argument("<html>", "HTML 代码字符串或 HTML 文件路径")
|
|
76
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
77
|
+
.option("-t, --title <title>", "文档标题(用作文件名基础)")
|
|
78
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
79
|
+
.action((html, options) => {
|
|
80
|
+
publishCommand(html, options);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// webpage 子命令组(统一发布 Markdown/HTML 为在线网页)
|
|
84
|
+
const webpageCmd = program
|
|
85
|
+
.command("webpage")
|
|
86
|
+
.description("网页发布(支持 Markdown 和 HTML)");
|
|
87
|
+
|
|
88
|
+
webpageCmd
|
|
89
|
+
.command("publish")
|
|
90
|
+
.description("将 Markdown 或 HTML 发布为在线网页(自动识别类型)")
|
|
91
|
+
.argument("<input>", "Markdown/HTML 文本字符串或文件路径")
|
|
92
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
93
|
+
.option("-t, --title <title>", "文件名(不含 .html 后缀)")
|
|
94
|
+
.option("--type <type>", "强制指定类型:md 或 html(默认自动识别)")
|
|
95
|
+
.option("--copy-button", "添加代码复制按钮(仅 Markdown 类型生效)")
|
|
96
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
97
|
+
.action((input, options) => {
|
|
98
|
+
webpagePublishCommand(input, options);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
webpageCmd
|
|
102
|
+
.command("list")
|
|
103
|
+
.description("查询当前用户已发布的网页")
|
|
104
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
105
|
+
.option("--page <page>", "页码,最小为 1", "1")
|
|
106
|
+
.option("--page-size <size>", "每页条数,范围为 1 到 100", "20")
|
|
107
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
108
|
+
.action((options) => {
|
|
109
|
+
webpageListCommand(options);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
webpageCmd
|
|
113
|
+
.command("delete")
|
|
114
|
+
.description("删除当前用户指定的已发布网页")
|
|
115
|
+
.argument("<webpage_id>", "网页记录 ID,可通过 webpage list 获取")
|
|
116
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
117
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
118
|
+
.action((webpageId, options) => {
|
|
119
|
+
webpageDeleteCommand(webpageId, options);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// search 子命令组
|
|
123
|
+
const searchCmd = program
|
|
124
|
+
.command("search")
|
|
125
|
+
.description("网页/图片搜索");
|
|
126
|
+
|
|
127
|
+
searchCmd
|
|
128
|
+
.command("web")
|
|
129
|
+
.description("网页搜索")
|
|
130
|
+
.argument("<query>", "搜索关键词(1~100字符)")
|
|
131
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
132
|
+
.option("-n, --count <n>", "返回条数(最多50)")
|
|
133
|
+
.option("--time-range <range>", "时间范围:OneDay/OneWeek/OneMonth/OneYear 或 YYYY-MM-DD..YYYY-MM-DD")
|
|
134
|
+
.option("--need-content", "仅返回包含正文的结果")
|
|
135
|
+
.option("--need-url", "仅返回带原文链接的结果")
|
|
136
|
+
.option("--sites <domains>", "限定搜索站点,完整域名以 | 分隔,最多20个")
|
|
137
|
+
.option("--block-hosts <domains>", "屏蔽站点,完整域名以 | 分隔,最多5个")
|
|
138
|
+
.option("--auth-info-level <level>", "权威度过滤:0=不限制,1=仅非常权威内容")
|
|
139
|
+
.option("--auth-level <level>", "兼容别名,等同 --auth-info-level")
|
|
140
|
+
.option("--content-format <format>", "正文格式:text 或 markdown", "text")
|
|
141
|
+
.option("--industry <type>", "行业搜索:finance、game 或 gov")
|
|
142
|
+
.option("--query-rewrite", "开启 Query 改写")
|
|
143
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
144
|
+
.action((query, options) => {
|
|
145
|
+
searchCommand(query, "web", options);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
searchCmd
|
|
149
|
+
.command("image")
|
|
150
|
+
.description("图片搜索")
|
|
151
|
+
.argument("<query>", "搜索关键词(1~100字符)")
|
|
152
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
153
|
+
.option("-n, --count <n>", "返回条数(最多5)")
|
|
154
|
+
.option("--image-width-min <px>", "图片最小宽度")
|
|
155
|
+
.option("--image-width-max <px>", "图片最大宽度")
|
|
156
|
+
.option("--image-height-min <px>", "图片最小高度")
|
|
157
|
+
.option("--image-height-max <px>", "图片最大高度")
|
|
158
|
+
.option("--image-shapes <shapes>", "图片形状,以 | 分隔:横长方形、竖长方形、方形")
|
|
159
|
+
.option("--query-rewrite", "开启 Query 改写")
|
|
160
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
161
|
+
.action((query, options) => {
|
|
162
|
+
searchCommand(query, "image", options);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// content 子命令组
|
|
166
|
+
const contentCmd = program
|
|
167
|
+
.command("content")
|
|
168
|
+
.description("内容选题与素材工具");
|
|
169
|
+
|
|
170
|
+
contentCmd
|
|
171
|
+
.command("briefing")
|
|
172
|
+
.description("聚合多平台热点与小红书热榜,生成选题原料")
|
|
173
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
174
|
+
.option("--sources <ids>", "来源 ID,逗号分隔;默认 zhihu,weibo,douyin,aihot")
|
|
175
|
+
.option("--limit <n>", "每个来源返回条数,范围 1 到 30", "30")
|
|
176
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
177
|
+
.action((options) => {
|
|
178
|
+
briefingCommand(options);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// 未知命令处理
|
|
182
|
+
|
|
183
|
+
// douyin 子命令组
|
|
184
|
+
const douyinCmd = program
|
|
185
|
+
.command("douyin")
|
|
186
|
+
.description("抖音数据工具箱");
|
|
187
|
+
|
|
188
|
+
douyinCmd
|
|
189
|
+
.command("video-info")
|
|
190
|
+
.description("获取抖音作品详情(0.01元/次)")
|
|
191
|
+
.argument("<share_url>", "抖音视频分享链接")
|
|
192
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
193
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
194
|
+
.action((shareUrl, options) => { videoInfoCommand(shareUrl, options); });
|
|
195
|
+
|
|
196
|
+
douyinCmd
|
|
197
|
+
.command("video-comments")
|
|
198
|
+
.description("获取抖音作品评论(0.01元/次)")
|
|
199
|
+
.argument("<video_url>", "抖音视频URL")
|
|
200
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
201
|
+
.option("--max-count <n>", "获取评论数量", "50")
|
|
202
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
203
|
+
.action((videoUrl, options) => { videoCommentsCommand(videoUrl, options); });
|
|
204
|
+
|
|
205
|
+
douyinCmd
|
|
206
|
+
.command("user-videos")
|
|
207
|
+
.description("获取抖音用户视频列表(0.03元/页)")
|
|
208
|
+
.argument("<home_page>", "抖音用户主页URL")
|
|
209
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
210
|
+
.option("--max-pages <n>", "最大页数", "1")
|
|
211
|
+
.option("--max-seconds <n>", "最长运行时间(秒),最大180", "50")
|
|
212
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
213
|
+
.action((homePage, options) => { userVideosCommand(homePage, options); });
|
|
214
|
+
|
|
215
|
+
douyinCmd
|
|
216
|
+
.command("user-detail")
|
|
217
|
+
.description("获取抖音用户详情(0.03元/次)")
|
|
218
|
+
.argument("<home_page>", "抖音用户主页URL")
|
|
219
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
220
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
221
|
+
.action((homePage, options) => { userDetailCommand(homePage, options); });
|
|
222
|
+
|
|
223
|
+
douyinCmd
|
|
224
|
+
.command("user-search")
|
|
225
|
+
.description("搜索抖音用户(0.15元/页)")
|
|
226
|
+
.argument("<keyword>", "搜索关键词")
|
|
227
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
228
|
+
.option("--max-pages <n>", "最大页数,0=不限制", "1")
|
|
229
|
+
.option("--max-seconds <n>", "最长运行时间(秒),最大180", "50")
|
|
230
|
+
.option("--fans-range <range>", "粉丝数量筛选:0_1k/1k_1w/1w_10w/10w_100w/100w_")
|
|
231
|
+
.option("--user-type <type>", "用户类型筛选:common_user/enterprise_user/personal_user")
|
|
232
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
233
|
+
.action((keyword, options) => { userSearchCommand(keyword, options); });
|
|
234
|
+
|
|
235
|
+
douyinCmd
|
|
236
|
+
.command("video-search")
|
|
237
|
+
.description("搜索抖音视频(0.15元/页)")
|
|
238
|
+
.argument("<keyword>", "搜索关键词")
|
|
239
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
240
|
+
.option("--max-pages <n>", "最大页数,0=不限制", "1")
|
|
241
|
+
.option("--max-seconds <n>", "最长运行时间(秒),最大50", "50")
|
|
242
|
+
.option("--sort-type <type>", "排序方式:0=综合,1=最多点赞,2=最新发布", "0")
|
|
243
|
+
.option("--publish-time <time>", "发布时间:0=不限,1=一天,7=一周,180=半年", "0")
|
|
244
|
+
.option("--filter-duration <dur>", "视频时长:0=不限,0-1=1分钟内,1-5=1-5分钟,5-10000=5分钟以上", "0")
|
|
245
|
+
.option("--content-type <type>", "内容类型:0=不限,1=视频,2=图片,3=文章", "0")
|
|
246
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
247
|
+
.action((keyword, options) => { videoSearchCommand(keyword, options); });
|
|
248
|
+
|
|
249
|
+
douyinCmd
|
|
250
|
+
.command("download")
|
|
251
|
+
.description("抖音视频下载:普通清晰度多档直链(原画请用 video-original)")
|
|
252
|
+
.argument("<video-url>", "抖音链接、分享文案或作品 ID")
|
|
253
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
254
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
255
|
+
.action((videoUrl, options) => {
|
|
256
|
+
downloadCommand(videoUrl, options);
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
douyinCmd
|
|
260
|
+
.command("video-original")
|
|
261
|
+
.description("抖音原画下载:取最高画质播放直链(普通清晰度请用 download)")
|
|
262
|
+
.argument("<video-url>", "抖音链接、分享文案或作品 ID")
|
|
263
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
264
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
265
|
+
.action((videoUrl, options) => {
|
|
266
|
+
videoOriginalCommand(videoUrl, options);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
douyinCmd
|
|
270
|
+
.command("topic-radar")
|
|
271
|
+
.description("抖音选题雷达:热词榜 + 当前热点 + 飙升热点(并行调用三个原子接口)")
|
|
272
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
273
|
+
.option("-n, --limit <n>", "飙升榜条数(1~20,默认 10)")
|
|
274
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
275
|
+
.action((options) => {
|
|
276
|
+
topicRadarCommand(options);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
douyinCmd
|
|
280
|
+
.command("link-to-text")
|
|
281
|
+
.description("抖音作品链接转文字(0.01元/次 + 0.0003元/秒)")
|
|
282
|
+
.argument("<video_url>", "抖音视频URL")
|
|
283
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
284
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
285
|
+
.action((videoUrl, options) => { linkToTextCommand(videoUrl, options); });
|
|
286
|
+
|
|
287
|
+
// xhs 子命令组
|
|
288
|
+
const xhsCmd = program
|
|
289
|
+
.command("xhs")
|
|
290
|
+
.description("小红书数据工具箱");
|
|
291
|
+
|
|
292
|
+
xhsCmd
|
|
293
|
+
.command("hot-list")
|
|
294
|
+
.description("获取小红书实时热榜")
|
|
295
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
296
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
297
|
+
.action((options) => { xhsHotListCommand(options); });
|
|
298
|
+
|
|
299
|
+
xhsCmd
|
|
300
|
+
.command("note-publish")
|
|
301
|
+
.description("生成小红书扫码发布页与二维码(0.05元/次)")
|
|
302
|
+
.argument("<type>", "笔记类型:normal(图文)或 video(视频)")
|
|
303
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
304
|
+
.option("-t, --title <title>", "笔记标题(最多20字符)")
|
|
305
|
+
.option("--content <text>", "笔记正文(最多1000字符)")
|
|
306
|
+
.option("--images <urls>", "图片公网URL列表,逗号分隔(normal类型,最多18张)")
|
|
307
|
+
.option("--image-file <path>", "本地图片路径,可重复使用(normal类型,最多18张)", collect)
|
|
308
|
+
.option("--image-base64 <data>", "图片Base64/data URL/@文本文件,可重复使用", collect)
|
|
309
|
+
.option("--video <url>", "视频公网URL(与--video-file、--video-base64三选一)")
|
|
310
|
+
.option("--video-file <path>", "本地视频路径(与--video、--video-base64三选一)")
|
|
311
|
+
.option("--video-base64 <data>", "视频Base64/data URL/@文本文件(与其他视频来源三选一)")
|
|
312
|
+
.option("--cover <url>", "视频封面图公网URL(与其他封面来源三选一)")
|
|
313
|
+
.option("--cover-file <path>", "本地视频封面路径(仅video类型有效)")
|
|
314
|
+
.option("--cover-base64 <data>", "视频封面Base64/data URL/@文本文件(仅video类型)")
|
|
315
|
+
.option("--upload-valid-days <days>", "本地/Base64素材临时链接有效期:1或7天", "7")
|
|
316
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
317
|
+
.action((type, options) => { notePublishCommand(type, options); });
|
|
318
|
+
|
|
319
|
+
xhsCmd
|
|
320
|
+
.command("note")
|
|
321
|
+
.description("获取小红书笔记详情(按次计费)")
|
|
322
|
+
.argument("<ref>", "笔记链接、xhslink 短链、分享口令或 24 位 note_id")
|
|
323
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
324
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
325
|
+
.action((ref, options) => { xhsNoteCommand(ref, options); });
|
|
326
|
+
|
|
327
|
+
xhsCmd
|
|
328
|
+
.command("comments")
|
|
329
|
+
.description("获取小红书笔记评论,含可见的楼内回复(按成功翻页计费)")
|
|
330
|
+
.argument("<ref>", "笔记链接、xhslink 短链、分享口令或 24 位 note_id")
|
|
331
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
332
|
+
.option("--max-pages <n>", "最大翻页数,范围 1~5(每页约 10 条)", "1")
|
|
333
|
+
.option("--max-seconds <n>", "最长运行时间(秒),最大 170", "50")
|
|
334
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
335
|
+
.action((ref, options) => { xhsCommentsCommand(ref, options); });
|
|
336
|
+
|
|
337
|
+
xhsCmd
|
|
338
|
+
.command("search")
|
|
339
|
+
.description("按关键词搜索小红书笔记(按成功翻页计费,每页约 20 条)")
|
|
340
|
+
.argument("<keyword>", "搜索关键词")
|
|
341
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
342
|
+
.option("--sort <sort>", "排序:general/time_descending/popularity_descending/comment_descending/collect_descending")
|
|
343
|
+
.option("--note-time <range>", "发布时间:day/week/halfyear(不传=不限)")
|
|
344
|
+
.option("--note-type <type>", "笔记类型:video/note(不传=不限)")
|
|
345
|
+
.option("--max-pages <n>", "最大翻页数,范围 1~5", "1")
|
|
346
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
347
|
+
.action((keyword, options) => { xhsSearchCommand(keyword, options); });
|
|
348
|
+
|
|
349
|
+
xhsCmd
|
|
350
|
+
.command("user")
|
|
351
|
+
.description("获取小红书用户详情(按次计费)")
|
|
352
|
+
.argument("<ref>", "主页链接 /user/profile/ 或 24 位 user_id")
|
|
353
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
354
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
355
|
+
.action((ref, options) => { xhsUserCommand(ref, options); });
|
|
356
|
+
|
|
357
|
+
xhsCmd
|
|
358
|
+
.command("daren-report")
|
|
359
|
+
.description("小红书达人报告:详情 + 粉丝画像 + 笔记性价比(并行调用三个原子接口并打分)")
|
|
360
|
+
.argument("<input>", "达人 user_id(24 位十六进制)或主页链接")
|
|
361
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
362
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
363
|
+
.action((input, options) => {
|
|
364
|
+
xhsDarenReportCommand(input, options);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
xhsCmd
|
|
368
|
+
.command("user-notes")
|
|
369
|
+
.description("获取小红书用户笔记列表(按成功翻页计费,每页约 20 条)")
|
|
370
|
+
.argument("<ref>", "主页链接 /user/profile/ 或 24 位 user_id")
|
|
371
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
372
|
+
.option("--max-pages <n>", "最大翻页数,范围 1~5", "1")
|
|
373
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
374
|
+
.action((ref, options) => { xhsUserNotesCommand(ref, options); });
|
|
375
|
+
|
|
376
|
+
// wx 子命令组(公众号数据)
|
|
377
|
+
const wxCmd = program
|
|
378
|
+
.command("wx")
|
|
379
|
+
.description("微信公众号数据工具箱");
|
|
380
|
+
|
|
381
|
+
wxCmd
|
|
382
|
+
.command("article-data")
|
|
383
|
+
.description("获取公众号文章互动数据(按次计费)")
|
|
384
|
+
.argument("<url>", "微信文章链接")
|
|
385
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
386
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
387
|
+
.action((url, options) => { wxArticleDataCommand(url, options); });
|
|
388
|
+
|
|
389
|
+
wxCmd
|
|
390
|
+
.command("history")
|
|
391
|
+
.description("获取公众号历史文章列表(按成功翻页次数计费)")
|
|
392
|
+
.argument("[url]", "微信文章链接(用于定位公众号)")
|
|
393
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
394
|
+
.option("--name <name>", "公众号名称或微信 ID(与 url 至少提供一个)")
|
|
395
|
+
.option("--max-pages <n>", "最大翻页数量", "1")
|
|
396
|
+
.option("--max-seconds <n>", "最长运行时间(秒),最大 170", "50")
|
|
397
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
398
|
+
.action((url, options) => { wxHistoryCommand(url, options); });
|
|
399
|
+
|
|
400
|
+
// 未知命令处理
|
|
401
|
+
program.on("command:*", () => {
|
|
402
|
+
console.error(`未知命令: ${program.args.join(" ")}`);
|
|
403
|
+
console.error("使用 --help 查看可用命令。");
|
|
404
|
+
process.exit(1);
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
program.parse(process.argv);
|
|
408
|
+
|
|
409
|
+
// 没有参数时显示帮助
|
|
410
|
+
if (!process.argv.slice(2).length) {
|
|
411
|
+
program.outputHelp();
|
|
412
|
+
}
|