@yizhuan-cli/cli 0.1.10 → 0.1.11-beta.1
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 +15 -1
- package/resources/yizhuan-cli/manifest.json +4 -4
- package/src/doctor.js +2 -2
- package/src/index.js +3 -0
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.11-beta.1
|
|
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.11-beta.1 --registry=https://your-private-registry.example
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 配置
|
package/package.json
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yizhuan-cli
|
|
3
3
|
description: |
|
|
4
|
-
|
|
4
|
+
安装、配置并使用易撰 CLI(yizhuan 命令)查询真实数据的全量 Skill,处理作品、作者、全网搜索、热点、竞品动态、会员、灵感、收藏和一键检测;若已安装用户明确指定平台对应的 yizhuan-<platform> Skill,必须优先使用对应的拆分平台 Skill。业务数据禁止臆造。
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# 易撰 CLI
|
|
8
8
|
|
|
9
9
|
使用本机 `yizhuan` 命令访问易撰数据。所有查询以 CLI JSON 输出为准,不在对话、日志、Skill 文件或临时请求文件中写入 API Key。
|
|
10
10
|
|
|
11
|
+
## 首次安装与配置
|
|
12
|
+
|
|
13
|
+
用户要求安装或配置本 Skill 时,在一次流程中完成以下操作,不要求用户另行安装其他易撰 Skill:
|
|
14
|
+
|
|
15
|
+
1. 检查 Node.js 22+ 和 npm。
|
|
16
|
+
2. 若 `yizhuan` 命令不存在,说明将全局安装最新稳定版 CLI,并取得一次明确授权后执行 `npm install -g @yizhuan-cli/cli@latest`。
|
|
17
|
+
3. 执行 `yizhuan --version` 和 `yizhuan skill sync --global`。
|
|
18
|
+
4. 执行 `yizhuan config init`,API Key 必须由用户在本机不回显终端输入,禁止要求用户粘贴到对话中。
|
|
19
|
+
5. 执行 `yizhuan doctor --global`;通过后即可在同一 Skill 中处理全部业务查询。
|
|
20
|
+
|
|
21
|
+
除全局 npm 安装授权和 API Key 的安全输入外,Agent 应连续完成安装、同步、配置和诊断,不把流程拆成需要用户逐步确认的多轮操作。
|
|
22
|
+
|
|
11
23
|
## 环境检查
|
|
12
24
|
|
|
13
25
|
开始业务查询前运行:
|
|
@@ -38,11 +50,13 @@ yizhuan doctor
|
|
|
38
50
|
| 竞品动态 | `yizhuan execute --ability radar --mode timeline --timeRange 7d` |
|
|
39
51
|
| 会员 | `yizhuan execute --ability membership` |
|
|
40
52
|
| 我的灵感 / 灵感库 / 收藏作品 | `yizhuan execute --ability favorites` |
|
|
53
|
+
| 一键检测 | 将标题和正文写入临时 JSON 文件后执行 `yizhuan execute --ability detection --json-file <file>` |
|
|
41
54
|
|
|
42
55
|
## 调用规则
|
|
43
56
|
|
|
44
57
|
- 需要真实易撰数据时必须调用 CLI,不直接猜测结果。
|
|
45
58
|
- 一键检测的原创度检测当前只有百度引擎。展示检测结果时使用 `data.originalScore` 和 `data.originalEngine`;不得把历史兼容字段 `_360`、`sogou`、`zonghe` 展示为检测引擎或额外得分。
|
|
59
|
+
- 一键检测支持 `submit`、`get` 和 `wait` 模式。`wait` 必须按照服务端 `pollAfterSeconds` 轮询;pending、failed、timeout 状态必须如实报告,成功、失败或超时后均清理包含标题和正文的临时 JSON 文件。
|
|
46
60
|
- PowerShell 使用单引号包裹 JSON。终端可能改写引号时,将不含密钥的请求对象写入文件,再使用 `--json-file`。
|
|
47
61
|
- `execute --json-file` 是完整参数对象的唯一输入源,不与 `--params`、`--query` 或独立参数混用。
|
|
48
62
|
- 热点查询使用 `query` 统一协议并明确 `platform`;缺少平台时先澄清,不默认猜测。
|
|
@@ -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.11-beta.1",
|
|
5
|
+
"compatibleCliVersion": "0.1.11-beta.1",
|
|
6
|
+
"source": "npm:@yizhuan-cli/cli@0.1.11-beta.1",
|
|
7
7
|
"digestAlgorithm": "sha256",
|
|
8
8
|
"files": [
|
|
9
9
|
{
|
|
10
10
|
"path": "SKILL.md",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "a01401451f9931f26f6ed9154f2e9720073c88a3576aa58a98a87fd6eef2c045"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
package/src/doctor.js
CHANGED
|
@@ -53,9 +53,9 @@ export function inspectLocalEnvironment(
|
|
|
53
53
|
? check('pass', 'node', `Node.js ${nodeVersion} 满足 >=${minimumNode}`)
|
|
54
54
|
: check('fail', 'node', `Node.js ${nodeVersion} 不满足 ${packageJson.engines?.node || '版本要求'}`, `安装 Node.js ${minimumNode || 22} 或更高版本。`))
|
|
55
55
|
|
|
56
|
-
checks.push(packageJson.version === '0.1.
|
|
56
|
+
checks.push(packageJson.version === '0.1.11-beta.1'
|
|
57
57
|
? check('pass', 'cli_version', `CLI ${packageJson.version}`)
|
|
58
|
-
: check('fail', 'cli_version', `CLI 版本为 ${packageJson.version},预期 0.1.
|
|
58
|
+
: check('fail', 'cli_version', `CLI 版本为 ${packageJson.version},预期 0.1.11-beta.1`, '安装 @yizhuan-cli/cli@0.1.11-beta.1。'))
|
|
59
59
|
|
|
60
60
|
if (!exists(configPath)) {
|
|
61
61
|
checks.push(check('fail', 'config', `配置不存在:${configPath}`, '运行 yizhuan config init。'))
|
package/src/index.js
CHANGED
|
@@ -77,6 +77,9 @@ Notes:
|
|
|
77
77
|
- --json-file 是唯一参数源,不能与 --params、--query 或独立参数混用
|
|
78
78
|
- bash/zsh 也可用:--params '{"platform":"douyin"}' 或 --platform douyin
|
|
79
79
|
- 兼容 key=value:--params platform=douyin
|
|
80
|
+
- 统一 query 快照默认缓存 5 分钟;重复查询返回 isCached=true,并保留首次抓取的 fetchedAt
|
|
81
|
+
- 需要绕过快照缓存时,在 query JSON 中传 forceRefresh=true;响应会返回 cacheTtlSeconds 和 cacheExpiresAt
|
|
82
|
+
- 5 分钟是 CLI 快照缓存期限,不代表平台阅读、点赞等指标的上游更新频率;指标更新时间以平台实际返回为准
|
|
80
83
|
|
|
81
84
|
Abilities:
|
|
82
85
|
works 作品查询
|