@yizhuan-cli/cli 0.1.5 → 0.1.6
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 +2 -2
- package/package.json +1 -1
- package/resources/yizhuan-cli/SKILL.md +8 -4
- package/resources/yizhuan-cli/manifest.json +4 -4
- package/src/doctor.js +3 -3
- package/src/skill.js +4 -3
package/README.md
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
需要 Node.js 22 或更高版本。
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @yizhuan-cli/cli@0.1.
|
|
10
|
+
npm install -g @yizhuan-cli/cli@0.1.6
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
如果发布在私有 npm registry,请加上对应 registry:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install -g @yizhuan-cli/cli@0.1.
|
|
16
|
+
npm install -g @yizhuan-cli/cli@0.1.6 --registry=https://your-private-registry.example
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 配置
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: yizhuan-cli
|
|
3
3
|
description: |
|
|
4
4
|
通过易撰 CLI(yizhuan 命令)查询易撰真实数据。
|
|
5
|
-
|
|
5
|
+
当用户提到易撰、百家号、作品、账号、热点、雷达、竞品雷达、竞品动态、会员、我的灵感、灵感库、收藏作品、我的关注、关注作者或取消关注作者时,
|
|
6
6
|
必须优先调用 yizhuan CLI 获取真实结果,禁止臆造。
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -29,13 +29,13 @@ yizhuan doctor
|
|
|
29
29
|
| 作品 | `yizhuan execute --ability works --query "百家号昨天新增了哪些作品"` |
|
|
30
30
|
| 作品检索 | `yizhuan execute --ability works --params '{"mode":"search","keyword":"AI"}'` |
|
|
31
31
|
| 作者查询 | `yizhuan execute --ability accounts --query "张三"` |
|
|
32
|
-
| 作者指标筛选 | `yizhuan execute --ability author_query --params '{"platform_id":2,"min_follower":500000}'` |
|
|
32
|
+
| 作者指标筛选 | `yizhuan execute --ability author_query --params '{"platform_id":2,"min_follower":500000,"min_total_likes":100000}'` |
|
|
33
33
|
| 作者全网搜索 | `yizhuan query --json '{"intent":"author_search","scope":"public","platform":"douyin","keyword":"张三"}'` |
|
|
34
34
|
| 热点 | `yizhuan query --json '{"intent":"hot_topics","scope":"platform","platform":"douyin","timeRange":"today"}'` |
|
|
35
35
|
| 我的关注 | `yizhuan execute --ability radar --params '{"mode":"following"}'` |
|
|
36
36
|
| 竞品动态 | `yizhuan execute --ability radar --mode timeline --timeRange 7d` |
|
|
37
37
|
| 会员 | `yizhuan execute --ability membership` |
|
|
38
|
-
| 收藏作品 | `yizhuan execute --ability favorites` |
|
|
38
|
+
| 我的灵感 / 灵感库 / 收藏作品 | `yizhuan execute --ability favorites` |
|
|
39
39
|
|
|
40
40
|
## 调用规则
|
|
41
41
|
|
|
@@ -43,9 +43,13 @@ yizhuan doctor
|
|
|
43
43
|
- PowerShell 使用单引号包裹 JSON。终端可能改写引号时,将不含密钥的请求对象写入文件,再使用 `--json-file`。
|
|
44
44
|
- `execute --json-file` 是完整参数对象的唯一输入源,不与 `--params`、`--query` 或独立参数混用。
|
|
45
45
|
- 热点查询使用 `query` 统一协议并明确 `platform`;缺少平台时先澄清,不默认猜测。
|
|
46
|
+
- 平台热点必须严格按 CLI 返回的 `data.items` / `rank` 顺序展示,该顺序与 Web 端平台榜单一致;`hot` 仅为展示指标,禁止按 `hot` 或格式化后的“万”值二次排序。
|
|
47
|
+
- 使用 Markdown 表格展示热点时,必须将标题中的 `|` 转义为 `\|`,不得让标题内容错位到热度列。
|
|
46
48
|
- 全网作者搜索使用 `intent=author_search`、`scope=public`,并提供 `platform` 和 `keyword`。
|
|
47
|
-
- 作者累计指标筛选使用 `author_query
|
|
49
|
+
- 作者累计指标筛选使用 `author_query`,不得改成作品指标或擅自降低阈值。必须逐项映射用户给出的所有条件:粉丝使用 `min_follower` / `max_follower`,点赞使用 `min_total_likes` / `max_total_likes`,阅读使用 `min_total_views` / `max_total_views`,关注使用 `min_friends` / `max_friends`,作品数使用 `min_work_count` / `max_work_count`;复合条件不得遗漏任何字段。例如“百家号粉丝大于50万,点赞大于10万”必须同时传 `platform_id:2`、`min_follower:500000` 和 `min_total_likes:100000`。
|
|
50
|
+
- 作者指标查询返回后,必须核对 `data.items` 中所有已请求指标。指标缺失、显示“暂未返回”或低于/高于用户阈值的项目不得作为符合条件的结果展示;一旦发现此类项目,必须先检查实际请求参数是否遗漏对应的 min/max 字段并使用完整参数重新查询,禁止直接报告原总数。
|
|
48
51
|
- “我的关注作者”使用 `radar` 且 `mode=following`,不是作品收藏。
|
|
52
|
+
- “我的灵感”“灵感库”“灵感作品”“我的收藏”和“收藏作品”是同一业务概念,均直接使用 `favorites`;不得尝试 `inspiration` 等不存在的 ability,也不要反问用户是不是指收藏作品。
|
|
49
53
|
- 竞品动态使用 `radar` 且 `mode=timeline`;未给时间范围时使用 `timeRange=7d`。
|
|
50
54
|
- 关注或取消关注属于写操作,必须来自用户明确指令;执行前核对昵称、平台和标识,不批量猜测目标。
|
|
51
55
|
- 取消关注前先查询关注列表,使用匹配项的 `articleId`,不得因结果不符合预期自行取消。
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "yizhuan-cli",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"compatibleCliVersion": "0.1.
|
|
6
|
-
"source": "npm:@yizhuan-cli/cli@0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
|
+
"compatibleCliVersion": "0.1.6",
|
|
6
|
+
"source": "npm:@yizhuan-cli/cli@0.1.6",
|
|
7
7
|
"digestAlgorithm": "sha256",
|
|
8
8
|
"files": [
|
|
9
9
|
{
|
|
10
10
|
"path": "SKILL.md",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "66fa2442fe0624b5e5425ab753412a5d153fdda11b69e70a2defcad78dfc7665"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
package/src/doctor.js
CHANGED
|
@@ -52,9 +52,9 @@ export function inspectLocalEnvironment(
|
|
|
52
52
|
? check('pass', 'node', `Node.js ${nodeVersion} 满足 >=${minimumNode}`)
|
|
53
53
|
: check('fail', 'node', `Node.js ${nodeVersion} 不满足 ${packageJson.engines?.node || '版本要求'}`, `安装 Node.js ${minimumNode || 22} 或更高版本。`))
|
|
54
54
|
|
|
55
|
-
checks.push(packageJson.version === '0.1.
|
|
55
|
+
checks.push(packageJson.version === '0.1.6'
|
|
56
56
|
? check('pass', 'cli_version', `CLI ${packageJson.version}`)
|
|
57
|
-
: check('fail', 'cli_version', `CLI 版本为 ${packageJson.version},预期 0.1.
|
|
57
|
+
: check('fail', 'cli_version', `CLI 版本为 ${packageJson.version},预期 0.1.6`, '安装 @yizhuan-cli/cli@0.1.6。'))
|
|
58
58
|
|
|
59
59
|
if (!exists(configPath)) {
|
|
60
60
|
checks.push(check('fail', 'config', `配置不存在:${configPath}`, '运行 yizhuan config init。'))
|
|
@@ -256,7 +256,7 @@ export function printDoctorHelp() {
|
|
|
256
256
|
Options:
|
|
257
257
|
--json 输出稳定 JSON 结果
|
|
258
258
|
--global 检查用户级正式 Skill
|
|
259
|
-
--host 明确指定 codex、agents、claude 或 cursor
|
|
259
|
+
--host 明确指定 codex、agents、trae、claude 或 cursor
|
|
260
260
|
--help 显示本帮助`)
|
|
261
261
|
}
|
|
262
262
|
|
package/src/skill.js
CHANGED
|
@@ -14,6 +14,7 @@ const DEFAULT_RESOURCE_DIR = path.join(CLI_DIR, 'resources', OFFICIAL_SKILL_NAME
|
|
|
14
14
|
const HOSTS = {
|
|
15
15
|
codex: { directory: '.codex', configEnv: 'CODEX_HOME' },
|
|
16
16
|
agents: { directory: '.agents' },
|
|
17
|
+
trae: { directory: '.agent' },
|
|
17
18
|
claude: { directory: '.claude', configEnv: 'CLAUDE_CONFIG_DIR' },
|
|
18
19
|
cursor: { directory: '.cursor', configEnv: 'CURSOR_CONFIG_DIR' }
|
|
19
20
|
}
|
|
@@ -226,7 +227,7 @@ export function resolveSkillTarget(
|
|
|
226
227
|
if (environmentHosts.length === 1) {
|
|
227
228
|
selectedHost = environmentHosts[0][0]
|
|
228
229
|
} else if (environmentHosts.length > 1) {
|
|
229
|
-
throw new Error('检测到多个宿主环境,请使用 --host codex|agents|claude|cursor 明确指定。')
|
|
230
|
+
throw new Error('检测到多个宿主环境,请使用 --host codex|agents|trae|claude|cursor 明确指定。')
|
|
230
231
|
} else {
|
|
231
232
|
const root = global ? home : cwd
|
|
232
233
|
const directoryHosts = Object.entries(HOSTS).filter(([, config]) =>
|
|
@@ -238,7 +239,7 @@ export function resolveSkillTarget(
|
|
|
238
239
|
selectedHost = directoryHosts[0][0]
|
|
239
240
|
} else {
|
|
240
241
|
const reason = directoryHosts.length ? '检测到多个全局宿主' : '未检测到受支持宿主'
|
|
241
|
-
throw new Error(`${reason},请使用 --host codex|agents|claude|cursor 明确指定。`)
|
|
242
|
+
throw new Error(`${reason},请使用 --host codex|agents|trae|claude|cursor 明确指定。`)
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
}
|
|
@@ -260,7 +261,7 @@ export function printSkillSyncHelp() {
|
|
|
260
261
|
|
|
261
262
|
Options:
|
|
262
263
|
--global 安装到当前受支持宿主的用户级 Skill 目录
|
|
263
|
-
--host 明确指定 codex、agents、claude 或 cursor
|
|
264
|
+
--host 明确指定 codex、agents、trae、claude 或 cursor
|
|
264
265
|
--help 显示本帮助`)
|
|
265
266
|
}
|
|
266
267
|
|