aiconductor-cli 1.3.5 → 1.5.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/.agents/plans/2026-10-28T11-20-16-943Z-plan.md +161 -0
- package/AGENTS.md +157 -78
- package/README.md +49 -5
- package/api_docs/douyin_user_videos.md +2 -2
- package/api_docs/wx_history_articles.md +39 -20
- package/bin/aiconductor-cli.js +129 -94
- package/package.json +1 -1
- package/src/api.js +364 -268
- package/src/api.test.js +265 -3
- package/src/commands/content.js +99 -5
- package/src/commands/wx.js +116 -0
- package/src/commands/xhs.js +268 -225
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
6
|
|
|
7
7
|
## 功能说明
|
|
8
|
-
获取微信公众号历史文章列表,支持自动翻页与按页计费。为**计费插件**:按成功翻页次数计费(每翻一页扣费一次),费用以 `api_services` 表(`service_code=get_wx_history_article
|
|
8
|
+
获取微信公众号历史文章列表,支持自动翻页与按页计费。为**计费插件**:按成功翻页次数计费(每翻一页扣费一次),费用以 `api_services` 表(`service_code=get_wx_history_article`)配置为准。底层已由 `page` 迁移至 `offset + is_end` 翻页(兼容旧版 `total_page/now_page`),可通过 `max_pages` / `max_seconds` 控制自动翻页。
|
|
9
9
|
|
|
10
10
|
## 请求参数
|
|
11
11
|
|
|
12
12
|
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
13
|
|--------|------|------|--------|------|
|
|
14
14
|
| url | string | 否* | - | 微信文章链接(用于定位公众号)。与 `name` 至少提供一个 |
|
|
15
|
-
| name | string | 否* | - | 公众号名称或微信 ID(调用参数名 `name`) |
|
|
15
|
+
| name | string | 否* | - | 公众号名称或微信 ID(调用参数名 `name`,上游映射为 `nickname`) |
|
|
16
16
|
| max_pages | int | 否 | `1` | 最大翻页数量 |
|
|
17
|
-
| max_seconds | int | 否 | `50` |
|
|
17
|
+
| max_seconds | int | 否 | `50` | 最长运行时长(秒),超时即停止翻页,**最大值 170**(默认50,传值>170自动截断为170,预留10s给平台180s超时) |
|
|
18
18
|
|
|
19
19
|
> **说明**:`url` 与 `name` 二者至少提供一个,否则返回失败。
|
|
20
20
|
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
@@ -34,20 +34,39 @@
|
|
|
34
34
|
| billing.pages_billed | int | 实际成功计费(翻页)页数 |
|
|
35
35
|
| billing.total_service_fee | float | 累计扣费总额 |
|
|
36
36
|
| billing.transaction_ids | array | 交易流水 ID 列表(每页一条) |
|
|
37
|
-
| data | object |
|
|
38
|
-
| data.code | int |
|
|
37
|
+
| data | object | 业务数据 |
|
|
38
|
+
| data.code | int | 上游返回码,`0` 为成功 |
|
|
39
39
|
| data.msg | string | `success` / `error` |
|
|
40
|
-
| data.data | array |
|
|
41
|
-
| data.
|
|
42
|
-
| data.
|
|
43
|
-
| data.
|
|
44
|
-
| data.
|
|
45
|
-
| data.
|
|
46
|
-
| data.
|
|
47
|
-
| data.
|
|
48
|
-
| data.
|
|
49
|
-
| data.
|
|
50
|
-
| data.
|
|
40
|
+
| data.data | array | 文章列表(已自动合并多页),每项结构见下表 |
|
|
41
|
+
| data.data[].position | int | 当次群发中的位置(1 开始) |
|
|
42
|
+
| data.data[].url | string | 文章链接(`mp.weixin.qq.com/s?...`) |
|
|
43
|
+
| data.data[].sn | string | 文章唯一 sn |
|
|
44
|
+
| data.data[].post_time | int | 发布时间戳(秒) |
|
|
45
|
+
| data.data[].post_time_str | string | 发布时间字符串,如 `2026-08-27 16:32:59` |
|
|
46
|
+
| data.data[].cover_url | string | 封面图 URL |
|
|
47
|
+
| data.data[].original | int | 是否原创:`0` 否 `1` 是 |
|
|
48
|
+
| data.data[].item_show_type | int | 展示类型 |
|
|
49
|
+
| data.data[].digest | string | 摘要(可能为空) |
|
|
50
|
+
| data.data[].title | string | 文章标题 |
|
|
51
|
+
| data.data[].appmsgid | int | appmsg ID |
|
|
52
|
+
| data.data[].update_time | int | 更新时间戳(秒) |
|
|
53
|
+
| data.data[].types | int | 类型标识 |
|
|
54
|
+
| data.data[].pic_cdn_url_235_1 | string | 封面 CDN 2.35:1 |
|
|
55
|
+
| data.data[].pic_cdn_url_16_9 | string | 封面 CDN 16:9 |
|
|
56
|
+
| data.data[].pic_cdn_url_1_1 | string | 封面 CDN 1:1 |
|
|
57
|
+
| data.data[].source_url | string | 原文链接(转载时有值,否则为空) |
|
|
58
|
+
| data.data[].read | int | 阅读数 |
|
|
59
|
+
| data.data[].zan | int | 点赞数 |
|
|
60
|
+
| data.total_num | int | 历史文章总数(旧版上游返回,新版通常为 `0`,以 `data.data.length` 为准) |
|
|
61
|
+
| data.total_page | int | 总页数(旧版上游返回,新版通常为 `0`) |
|
|
62
|
+
| data.publish_count | int | 发布次数(旧版上游返回,新版为 `0`) |
|
|
63
|
+
| data.masssend_count | int | 群发次数(旧版上游返回,新版为 `0`) |
|
|
64
|
+
| data.now_page | int | 实际已翻页数(等于 `billing.pages_billed`) |
|
|
65
|
+
| data.now_page_articles_num | int | 已获取文章总数(等于 `data.data.length`) |
|
|
66
|
+
| data.mp_nickname | string | 公众号昵称(使用 `name` 参数时返回,兼容 `nickname`) |
|
|
67
|
+
| data.mp_wxid | string | 公众号 wxid(兼容 `wxid`) |
|
|
68
|
+
| data.mp_ghid | string | 公众号 ghid(兼容 `ghid`) |
|
|
69
|
+
| data.head_img | string | 公众号头像 |
|
|
51
70
|
|
|
52
71
|
## 请求示例
|
|
53
72
|
|
|
@@ -63,8 +82,8 @@ curl -X POST "http://plugin.aiconductor.fun/api/wx_history_articles" \
|
|
|
63
82
|
```
|
|
64
83
|
|
|
65
84
|
## 注意事项
|
|
66
|
-
1.
|
|
67
|
-
2. **停止翻页条件**:余额不足、API
|
|
85
|
+
1. 本接口**按页计费**,每成功翻一页扣费一次;已扣费的页不退还。新版翻页依据上游 `offset` + `is_end`(`0` 表示还有下页),已兼容旧版 `total_page/now_page`。
|
|
86
|
+
2. **停止翻页条件**:余额不足、API 返回错误(`code!=0`)、`is_end=1` 或 `offset` 为空、达到 `max_pages` 或超过 `max_seconds` 任一满足即停止;`billing.pages_billed` / `total_service_fee` 反映实际扣费。
|
|
68
87
|
3. **不扣费场景**:缺少 `url` 与 `name`、API 密钥无效、账户被禁用——此时 `pages_billed=0`、`total_service_fee=0`、余额不变。
|
|
69
|
-
4. `data.data[]`
|
|
70
|
-
5. 每页请求最多重试 10
|
|
88
|
+
4. `data.data[]` 为跨页合并后的文章列表,单页条数由上游决定;`data.total_num/total_page/publish_count/masssend_count` 在新版上游中可能为 `0`,请以 `data.data.length` / `now_page_articles_num` 为准。
|
|
89
|
+
5. 每页请求最多重试 10 次;`max_seconds` 默认 50s,最大 170s(平台兜底180s),建议按需设置以避免触发平台 504 超时。
|
package/bin/aiconductor-cli.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
const { Command } = require("commander");
|
|
4
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 { briefingCommand } = require("../src/commands/content");
|
|
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 { briefingCommand } = require("../src/commands/content");
|
|
12
12
|
const {
|
|
13
13
|
videoInfoCommand,
|
|
14
14
|
videoCommentsCommand,
|
|
@@ -18,13 +18,17 @@ const {
|
|
|
18
18
|
videoSearchCommand,
|
|
19
19
|
linkToTextCommand,
|
|
20
20
|
} = require("../src/commands/douyin");
|
|
21
|
-
const { notePublishCommand } = require("../src/commands/xhs");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const { hotListCommand: xhsHotListCommand, notePublishCommand } = require("../src/commands/xhs");
|
|
22
|
+
const {
|
|
23
|
+
articleDataCommand: wxArticleDataCommand,
|
|
24
|
+
historyCommand: wxHistoryCommand,
|
|
25
|
+
} = require("../src/commands/wx");
|
|
26
|
+
|
|
27
|
+
const program = new Command();
|
|
28
|
+
|
|
29
|
+
function collect(value, previous) {
|
|
30
|
+
return previous ? previous.concat([value]) : [value];
|
|
31
|
+
}
|
|
28
32
|
|
|
29
33
|
program
|
|
30
34
|
.name("aiconductor-cli")
|
|
@@ -52,8 +56,8 @@ const webpageCmd = program
|
|
|
52
56
|
.command("webpage")
|
|
53
57
|
.description("网页发布(支持 Markdown 和 HTML)");
|
|
54
58
|
|
|
55
|
-
webpageCmd
|
|
56
|
-
.command("publish")
|
|
59
|
+
webpageCmd
|
|
60
|
+
.command("publish")
|
|
57
61
|
.description("将 Markdown 或 HTML 发布为在线网页(自动识别类型)")
|
|
58
62
|
.argument("<input>", "Markdown/HTML 文本字符串或文件路径")
|
|
59
63
|
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
@@ -61,30 +65,30 @@ webpageCmd
|
|
|
61
65
|
.option("--type <type>", "强制指定类型:md 或 html(默认自动识别)")
|
|
62
66
|
.option("--copy-button", "添加代码复制按钮(仅 Markdown 类型生效)")
|
|
63
67
|
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
64
|
-
.action((input, options) => {
|
|
65
|
-
webpagePublishCommand(input, options);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
webpageCmd
|
|
69
|
-
.command("list")
|
|
70
|
-
.description("查询当前用户已发布的网页")
|
|
71
|
-
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
72
|
-
.option("--page <page>", "页码,最小为 1", "1")
|
|
73
|
-
.option("--page-size <size>", "每页条数,范围为 1 到 100", "20")
|
|
74
|
-
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
75
|
-
.action((options) => {
|
|
76
|
-
webpageListCommand(options);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
webpageCmd
|
|
80
|
-
.command("delete")
|
|
81
|
-
.description("删除当前用户指定的已发布网页")
|
|
82
|
-
.argument("<webpage_id>", "网页记录 ID,可通过 webpage list 获取")
|
|
83
|
-
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
84
|
-
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
85
|
-
.action((webpageId, options) => {
|
|
86
|
-
webpageDeleteCommand(webpageId, options);
|
|
87
|
-
});
|
|
68
|
+
.action((input, options) => {
|
|
69
|
+
webpagePublishCommand(input, options);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
webpageCmd
|
|
73
|
+
.command("list")
|
|
74
|
+
.description("查询当前用户已发布的网页")
|
|
75
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
76
|
+
.option("--page <page>", "页码,最小为 1", "1")
|
|
77
|
+
.option("--page-size <size>", "每页条数,范围为 1 到 100", "20")
|
|
78
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
79
|
+
.action((options) => {
|
|
80
|
+
webpageListCommand(options);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
webpageCmd
|
|
84
|
+
.command("delete")
|
|
85
|
+
.description("删除当前用户指定的已发布网页")
|
|
86
|
+
.argument("<webpage_id>", "网页记录 ID,可通过 webpage list 获取")
|
|
87
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
88
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
89
|
+
.action((webpageId, options) => {
|
|
90
|
+
webpageDeleteCommand(webpageId, options);
|
|
91
|
+
});
|
|
88
92
|
|
|
89
93
|
// search 子命令组
|
|
90
94
|
const searchCmd = program
|
|
@@ -96,54 +100,54 @@ searchCmd
|
|
|
96
100
|
.description("网页搜索")
|
|
97
101
|
.argument("<query>", "搜索关键词(1~100字符)")
|
|
98
102
|
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
99
|
-
.option("-n, --count <n>", "返回条数(最多50)")
|
|
100
|
-
.option("--time-range <range>", "时间范围:OneDay/OneWeek/OneMonth/OneYear 或 YYYY-MM-DD..YYYY-MM-DD")
|
|
101
|
-
.option("--need-content", "仅返回包含正文的结果")
|
|
102
|
-
.option("--need-url", "仅返回带原文链接的结果")
|
|
103
|
-
.option("--sites <domains>", "限定搜索站点,完整域名以 | 分隔,最多20个")
|
|
104
|
-
.option("--block-hosts <domains>", "屏蔽站点,完整域名以 | 分隔,最多5个")
|
|
105
|
-
.option("--auth-info-level <level>", "权威度过滤:0=不限制,1=仅非常权威内容")
|
|
106
|
-
.option("--auth-level <level>", "兼容别名,等同 --auth-info-level")
|
|
107
|
-
.option("--content-format <format>", "正文格式:text 或 markdown", "text")
|
|
108
|
-
.option("--industry <type>", "行业搜索:finance、game 或 gov")
|
|
109
|
-
.option("--query-rewrite", "开启 Query 改写")
|
|
103
|
+
.option("-n, --count <n>", "返回条数(最多50)")
|
|
104
|
+
.option("--time-range <range>", "时间范围:OneDay/OneWeek/OneMonth/OneYear 或 YYYY-MM-DD..YYYY-MM-DD")
|
|
105
|
+
.option("--need-content", "仅返回包含正文的结果")
|
|
106
|
+
.option("--need-url", "仅返回带原文链接的结果")
|
|
107
|
+
.option("--sites <domains>", "限定搜索站点,完整域名以 | 分隔,最多20个")
|
|
108
|
+
.option("--block-hosts <domains>", "屏蔽站点,完整域名以 | 分隔,最多5个")
|
|
109
|
+
.option("--auth-info-level <level>", "权威度过滤:0=不限制,1=仅非常权威内容")
|
|
110
|
+
.option("--auth-level <level>", "兼容别名,等同 --auth-info-level")
|
|
111
|
+
.option("--content-format <format>", "正文格式:text 或 markdown", "text")
|
|
112
|
+
.option("--industry <type>", "行业搜索:finance、game 或 gov")
|
|
113
|
+
.option("--query-rewrite", "开启 Query 改写")
|
|
110
114
|
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
111
115
|
.action((query, options) => {
|
|
112
116
|
searchCommand(query, "web", options);
|
|
113
117
|
});
|
|
114
118
|
|
|
115
|
-
searchCmd
|
|
116
|
-
.command("image")
|
|
119
|
+
searchCmd
|
|
120
|
+
.command("image")
|
|
117
121
|
.description("图片搜索")
|
|
118
122
|
.argument("<query>", "搜索关键词(1~100字符)")
|
|
119
|
-
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
120
|
-
.option("-n, --count <n>", "返回条数(最多5)")
|
|
121
|
-
.option("--image-width-min <px>", "图片最小宽度")
|
|
122
|
-
.option("--image-width-max <px>", "图片最大宽度")
|
|
123
|
-
.option("--image-height-min <px>", "图片最小高度")
|
|
124
|
-
.option("--image-height-max <px>", "图片最大高度")
|
|
125
|
-
.option("--image-shapes <shapes>", "图片形状,以 | 分隔:横长方形、竖长方形、方形")
|
|
126
|
-
.option("--query-rewrite", "开启 Query 改写")
|
|
123
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
124
|
+
.option("-n, --count <n>", "返回条数(最多5)")
|
|
125
|
+
.option("--image-width-min <px>", "图片最小宽度")
|
|
126
|
+
.option("--image-width-max <px>", "图片最大宽度")
|
|
127
|
+
.option("--image-height-min <px>", "图片最小高度")
|
|
128
|
+
.option("--image-height-max <px>", "图片最大高度")
|
|
129
|
+
.option("--image-shapes <shapes>", "图片形状,以 | 分隔:横长方形、竖长方形、方形")
|
|
130
|
+
.option("--query-rewrite", "开启 Query 改写")
|
|
131
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
132
|
+
.action((query, options) => {
|
|
133
|
+
searchCommand(query, "image", options);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// content 子命令组
|
|
137
|
+
const contentCmd = program
|
|
138
|
+
.command("content")
|
|
139
|
+
.description("内容选题与素材工具");
|
|
140
|
+
|
|
141
|
+
contentCmd
|
|
142
|
+
.command("briefing")
|
|
143
|
+
.description("聚合多平台热点与小红书热榜,生成选题原料")
|
|
144
|
+
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
145
|
+
.option("--sources <ids>", "来源 ID,逗号分隔;默认 zhihu,weibo,douyin,aihot")
|
|
146
|
+
.option("--limit <n>", "每个来源返回条数,范围 1 到 30", "30")
|
|
127
147
|
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
128
|
-
.action((
|
|
129
|
-
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
// content 子命令组
|
|
133
|
-
const contentCmd = program
|
|
134
|
-
.command("content")
|
|
135
|
-
.description("内容选题与素材工具");
|
|
136
|
-
|
|
137
|
-
contentCmd
|
|
138
|
-
.command("briefing")
|
|
139
|
-
.description("聚合多平台热点,生成选题原料")
|
|
140
|
-
.option("-k, --api-key <key>", "AIConductor API Key(也可通过 AICONDUCTOR_API_KEY 环境变量或 .env 文件提供)")
|
|
141
|
-
.option("--sources <ids>", "来源 ID,逗号分隔;默认 zhihu,weibo,douyin,aihot")
|
|
142
|
-
.option("--limit <n>", "每个来源返回条数,范围 1 到 30", "30")
|
|
143
|
-
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
144
|
-
.action((options) => {
|
|
145
|
-
briefingCommand(options);
|
|
146
|
-
});
|
|
148
|
+
.action((options) => {
|
|
149
|
+
briefingCommand(options);
|
|
150
|
+
});
|
|
147
151
|
|
|
148
152
|
// 未知命令处理
|
|
149
153
|
|
|
@@ -226,26 +230,57 @@ const xhsCmd = program
|
|
|
226
230
|
.command("xhs")
|
|
227
231
|
.description("小红书数据工具箱");
|
|
228
232
|
|
|
233
|
+
xhsCmd
|
|
234
|
+
.command("hot-list")
|
|
235
|
+
.description("获取小红书实时热榜")
|
|
236
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
237
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
238
|
+
.action((options) => { xhsHotListCommand(options); });
|
|
239
|
+
|
|
229
240
|
xhsCmd
|
|
230
241
|
.command("note-publish")
|
|
231
|
-
.description("生成小红书扫码发布页与二维码(0.05元/次)")
|
|
242
|
+
.description("生成小红书扫码发布页与二维码(0.05元/次)")
|
|
232
243
|
.argument("<type>", "笔记类型:normal(图文)或 video(视频)")
|
|
233
244
|
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
234
|
-
.option("-t, --title <title>", "笔记标题(最多20字符)")
|
|
235
|
-
.option("--content <text>", "笔记正文(最多1000字符)")
|
|
236
|
-
.option("--images <urls>", "图片公网URL列表,逗号分隔(normal类型,最多18张)")
|
|
237
|
-
.option("--image-file <path>", "本地图片路径,可重复使用(normal类型,最多18张)", collect)
|
|
238
|
-
.option("--image-base64 <data>", "图片Base64/data URL/@文本文件,可重复使用", collect)
|
|
239
|
-
.option("--video <url>", "视频公网URL(与--video-file、--video-base64三选一)")
|
|
240
|
-
.option("--video-file <path>", "本地视频路径(与--video、--video-base64三选一)")
|
|
241
|
-
.option("--video-base64 <data>", "视频Base64/data URL/@文本文件(与其他视频来源三选一)")
|
|
242
|
-
.option("--cover <url>", "视频封面图公网URL(与其他封面来源三选一)")
|
|
243
|
-
.option("--cover-file <path>", "本地视频封面路径(仅video类型有效)")
|
|
244
|
-
.option("--cover-base64 <data>", "视频封面Base64/data URL/@文本文件(仅video类型)")
|
|
245
|
-
.option("--upload-valid-days <days>", "本地/Base64素材临时链接有效期:1或7天", "7")
|
|
246
|
-
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
245
|
+
.option("-t, --title <title>", "笔记标题(最多20字符)")
|
|
246
|
+
.option("--content <text>", "笔记正文(最多1000字符)")
|
|
247
|
+
.option("--images <urls>", "图片公网URL列表,逗号分隔(normal类型,最多18张)")
|
|
248
|
+
.option("--image-file <path>", "本地图片路径,可重复使用(normal类型,最多18张)", collect)
|
|
249
|
+
.option("--image-base64 <data>", "图片Base64/data URL/@文本文件,可重复使用", collect)
|
|
250
|
+
.option("--video <url>", "视频公网URL(与--video-file、--video-base64三选一)")
|
|
251
|
+
.option("--video-file <path>", "本地视频路径(与--video、--video-base64三选一)")
|
|
252
|
+
.option("--video-base64 <data>", "视频Base64/data URL/@文本文件(与其他视频来源三选一)")
|
|
253
|
+
.option("--cover <url>", "视频封面图公网URL(与其他封面来源三选一)")
|
|
254
|
+
.option("--cover-file <path>", "本地视频封面路径(仅video类型有效)")
|
|
255
|
+
.option("--cover-base64 <data>", "视频封面Base64/data URL/@文本文件(仅video类型)")
|
|
256
|
+
.option("--upload-valid-days <days>", "本地/Base64素材临时链接有效期:1或7天", "7")
|
|
257
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
247
258
|
.action((type, options) => { notePublishCommand(type, options); });
|
|
248
259
|
|
|
260
|
+
// wx 子命令组(公众号数据)
|
|
261
|
+
const wxCmd = program
|
|
262
|
+
.command("wx")
|
|
263
|
+
.description("微信公众号数据工具箱");
|
|
264
|
+
|
|
265
|
+
wxCmd
|
|
266
|
+
.command("article-data")
|
|
267
|
+
.description("获取公众号文章互动数据(按次计费)")
|
|
268
|
+
.argument("<url>", "微信文章链接")
|
|
269
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
270
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
271
|
+
.action((url, options) => { wxArticleDataCommand(url, options); });
|
|
272
|
+
|
|
273
|
+
wxCmd
|
|
274
|
+
.command("history")
|
|
275
|
+
.description("获取公众号历史文章列表(按成功翻页次数计费)")
|
|
276
|
+
.argument("[url]", "微信文章链接(用于定位公众号)")
|
|
277
|
+
.option("-k, --api-key <key>", "AIConductor API Key")
|
|
278
|
+
.option("--name <name>", "公众号名称或微信 ID(与 url 至少提供一个)")
|
|
279
|
+
.option("--max-pages <n>", "最大翻页数量", "1")
|
|
280
|
+
.option("--max-seconds <n>", "最长运行时间(秒),最大 170", "50")
|
|
281
|
+
.option("-f, --format <format>", "输出格式:json 或 text", "json")
|
|
282
|
+
.action((url, options) => { wxHistoryCommand(url, options); });
|
|
283
|
+
|
|
249
284
|
// 未知命令处理
|
|
250
285
|
program.on("command:*", () => {
|
|
251
286
|
console.error(`未知命令: ${program.args.join(" ")}`);
|