expert_eval_cli 1.0.0 → 1.0.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/dist/index.js CHANGED
@@ -12,7 +12,7 @@ function createProgram() {
12
12
  program
13
13
  .name('expert_eval')
14
14
  .description('AI-friendly CLI for ExpertEval API')
15
- .version('1.0.0')
15
+ .version('1.0.1')
16
16
  .option('--format <type>', 'Output format: json, table, or auto (default: auto)', 'auto')
17
17
  .option('-q, --quiet', 'Suppress output (exit codes only)', false);
18
18
  program.addCommand((0, auth_js_1.makeAuthCommand)());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expert_eval_cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "AI-friendly CLI for ExpertEval API — expert, version, eval-item and eval-record management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "dist/**/*",
12
+ "skill/**/*",
12
13
  "README.md",
13
14
  "LICENSE"
14
15
  ],
package/skill/SKILL.md ADDED
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: expert-eval-cli
3
+ version: "1.0.1"
4
+ description: >
5
+ ExpertEval CLI 工具技能:帮助用户安装、更新 expert_eval_cli,完成认证,
6
+ 并执行 experts、versions、eval-items、eval-records 的 CRUD 操作。
7
+ 当用户提到 ExpertEval、专家评估、评审记录、版本管理、评估项目时触发。
8
+ ---
9
+
10
+ # ExpertEval CLI 技能
11
+
12
+ 本技能帮助用户和 AI Agent 使用 `expert_eval_cli` 命令行工具与 ExpertEval API 交互。
13
+
14
+ ## 安装与更新
15
+
16
+ ### 首次安装
17
+
18
+ ```bash
19
+ npm install -g expert_eval_cli
20
+ ```
21
+
22
+ 验证安装:
23
+
24
+ ```bash
25
+ expert_eval --version
26
+ ```
27
+
28
+ ### 更新到最新版
29
+
30
+ ```bash
31
+ npm update -g expert_eval_cli
32
+ ```
33
+
34
+ 或先卸载再安装:
35
+
36
+ ```bash
37
+ npm uninstall -g expert_eval_cli
38
+ npm install -g expert_eval_cli
39
+ ```
40
+
41
+ ## 认证
42
+
43
+ ExpertEval CLI 支持两种方式提供 API Key:
44
+
45
+ ### 方式一:环境变量(推荐用于 CI/Agent)
46
+
47
+ ```bash
48
+ export EXPERT_EVAL_API_KEY="your-api-key-here"
49
+ export EXPERT_EVAL_BASE_URL="https://bytedance.feishuapp.com/app/app_17besd2kmya"
50
+ ```
51
+
52
+ ### 方式二:配置文件(推荐用于交互式使用)
53
+
54
+ ```bash
55
+ expert_eval auth login your-api-key-here
56
+ ```
57
+
58
+ 可选指定 Base URL:
59
+
60
+ ```bash
61
+ expert_eval auth login your-api-key-here --base-url https://bytedance-app_17besd2kmya-1872559030386954.aiforce.run/app/app_17besd2kmya
62
+ ```
63
+
64
+ 查看认证状态:
65
+
66
+ ```bash
67
+ expert_eval auth status
68
+ ```
69
+
70
+ 登出(删除本地保存的 key):
71
+
72
+ ```bash
73
+ expert_eval auth logout
74
+ ```
75
+
76
+ ### Key 查找优先级
77
+
78
+ 1. `EXPERT_EVAL_API_KEY` 环境变量
79
+ 2. `~/.config/expert-eval/config.json` 配置文件
80
+
81
+ ### Base URL 切换
82
+
83
+ - **线上环境**:`https://bytedance.feishuapp.com/app/app_17besd2kmya`(默认)
84
+ - **开发环境**:`https://bytedance-app_17besd2kmya-1872559030386954.aiforce.run/app/app_17besd2kmya`
85
+
86
+ 切换方式:
87
+
88
+ ```bash
89
+ # 临时切换(当前终端)
90
+ export EXPERT_EVAL_BASE_URL=https://bytedance-app_17besd2kmya-1872559030386954.aiforce.run/app/app_17besd2kmya
91
+
92
+ # 永久切换(重新登录)
93
+ expert_eval auth login your-api-key --base-url https://bytedance-app_17besd2kmya-1872559030386954.aiforce.run/app/app_17besd2kmya
94
+ ```
95
+
96
+ ## AI Agent 使用指南
97
+
98
+ Agent 调用 CLI 时,应优先使用 JSON 输出,便于解析:
99
+
100
+ ```bash
101
+ # 强制 JSON 输出
102
+ expert_eval --format json experts list
103
+
104
+ # 或使用环境变量确保非交互式 JSON
105
+ expert_eval experts list | cat
106
+ ```
107
+
108
+ ### 常用操作速查
109
+
110
+ | 操作 | 命令 |
111
+ |---|---|
112
+ | 列出专家 | `expert_eval experts list` |
113
+ | 创建专家 | `expert_eval experts create --expert-id exp-001 --name "AI安全专家"` |
114
+ | 更新专家 | `expert_eval experts update --expert-id exp-001 --name "新名称"` |
115
+ | 删除专家 | `expert_eval experts delete <id>` |
116
+ | 列出版本 | `expert_eval versions list --expert-id exp-001` |
117
+ | 创建版本 | `expert_eval versions create --expert-id exp-001 --hash abc123 --is-passed` |
118
+ | 列出评估项 | `expert_eval eval-items list` |
119
+ | 创建评估项 | `expert_eval eval-items create --title "接口规范性" --item-types structure,process` |
120
+ | 列出评审记录 | `expert_eval eval-records list --version-id v-1` |
121
+ | 创建评审记录 | `expert_eval eval-records create --version-id v-1 --eval-item-id ei-1 --is-passed` |
122
+
123
+ ### 分页查询
124
+
125
+ 所有 list 命令支持分页:
126
+
127
+ ```bash
128
+ expert_eval experts list --page 2 --page-size 20
129
+ ```
130
+
131
+ ### 错误处理
132
+
133
+ Agent 应检查 exit code:
134
+
135
+ - `0` — 成功
136
+ - `1` — 一般错误
137
+ - `2` — 认证错误
138
+ - `3` — 参数校验错误
139
+
140
+ JSON 错误输出格式:
141
+
142
+ ```json
143
+ {
144
+ "success": false,
145
+ "code": "HTTP_400",
146
+ "message": "Bad request",
147
+ "details": { "field": "name" }
148
+ }
149
+ ```
150
+
151
+ ## 参考资料
152
+
153
+ - `references/api-reference.md` — ExpertEval API 端点速查
@@ -0,0 +1,123 @@
1
+ # ExpertEval API Reference
2
+
3
+ Base URLs:
4
+ - Production: `https://bytedance.feishuapp.com/app/app_17besd2kmya`
5
+ - Development: `https://bytedance-app_17besd2kmya-1872559030386954.aiforce.run/app/app_17besd2kmya`
6
+
7
+ Auth: Bearer token via `Authorization: Bearer <API_KEY>` header.
8
+
9
+ ## Experts
10
+
11
+ ### `GET /openapi/experts`
12
+ List experts (paginated).
13
+
14
+ Query params:
15
+ - `page` (int, default 1)
16
+ - `pageSize` (int, default 50)
17
+ - `keyword` (string, optional)
18
+
19
+ Response: `{ items: Expert[], total, page, pageSize }`
20
+
21
+ ### `POST /openapi/experts`
22
+ Create expert (idempotent by `expertId`).
23
+
24
+ Body: `{ expertId, name, avatar?, tags?, description?, recommendedQuestion?, aiTags?, owner?, latestVersionId? }`
25
+
26
+ ### `PUT /openapi/experts`
27
+ Update expert (idempotent by `expertId`, creates if absent).
28
+
29
+ Body: same as POST, all fields required except those marked optional.
30
+
31
+ ### `GET /openapi/experts/{id}`
32
+ Get expert by primary ID.
33
+
34
+ ### `DELETE /openapi/experts/{id}`
35
+ Delete expert by primary ID.
36
+
37
+ Response: `{ id }`
38
+
39
+ ## Versions
40
+
41
+ ### `GET /openapi/versions`
42
+ List versions (paginated).
43
+
44
+ Query params:
45
+ - `page` (int, default 1)
46
+ - `pageSize` (int, default 50)
47
+ - `expertId` (string, optional filter)
48
+
49
+ ### `POST /openapi/versions`
50
+ Create version (idempotent by `expertId` + `hash`).
51
+
52
+ Body: `{ expertId, hash, commitMessage?, author?, versionDate?, isPassed, bac?, dcg? }`
53
+
54
+ ### `PUT /openapi/versions`
55
+ Update version (idempotent by `expertId` + `hash`).
56
+
57
+ Body: same shape as POST.
58
+
59
+ ### `GET /openapi/versions/{id}`
60
+ Get version by primary ID.
61
+
62
+ ### `DELETE /openapi/versions/{id}`
63
+ Delete version by primary ID.
64
+
65
+ Response: `{ id }`
66
+
67
+ ## Eval Items
68
+
69
+ ### `GET /openapi/eval-items`
70
+ List eval items (paginated).
71
+
72
+ Query params:
73
+ - `page` (int, default 1)
74
+ - `pageSize` (int, default 50)
75
+
76
+ ### `POST /openapi/eval-items`
77
+ Create eval item.
78
+
79
+ Body: `{ title, itemTypes?, query?, acceptanceCriteria?, isVeto? }`
80
+
81
+ `itemTypes` enum values: `structure`, `bac`, `dcg`, `process`, `deliver`.
82
+
83
+ ### `GET /openapi/eval-items/{id}`
84
+ Get eval item by primary ID.
85
+
86
+ ### `PUT /openapi/eval-items/{id}`
87
+ Update eval item by primary ID.
88
+
89
+ Body: `{ title?, itemTypes?, query?, acceptanceCriteria?, isVeto? }`
90
+
91
+ ### `DELETE /openapi/eval-items/{id}`
92
+ Delete eval item by primary ID.
93
+
94
+ Response: `{ id }`
95
+
96
+ ## Eval Records
97
+
98
+ ### `GET /openapi/eval-records`
99
+ List eval records (paginated).
100
+
101
+ Query params:
102
+ - `page` (int, default 1)
103
+ - `pageSize` (int, default 50)
104
+ - `versionId` (string, optional filter)
105
+ - `evalItemId` (string, optional filter)
106
+
107
+ ### `POST /openapi/eval-records`
108
+ Create eval record.
109
+
110
+ Body: `{ versionId, evalItemId, query?, result?, isPassed, bac?, dcg? }`
111
+
112
+ ### `GET /openapi/eval-records/{id}`
113
+ Get eval record by primary ID.
114
+
115
+ ### `PUT /openapi/eval-records/{id}`
116
+ Update eval record by primary ID.
117
+
118
+ Body: `{ versionId?, evalItemId?, query?, result?, isPassed?, bac?, dcg? }`
119
+
120
+ ### `DELETE /openapi/eval-records/{id}`
121
+ Delete eval record by primary ID.
122
+
123
+ Response: `{ id }`