tars-cli 0.1.4__tar.gz → 0.1.5__tar.gz

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.
Files changed (36) hide show
  1. tars_cli-0.1.5/PKG-INFO +267 -0
  2. tars_cli-0.1.5/README.md +247 -0
  3. {tars_cli-0.1.4 → tars_cli-0.1.5}/pyproject.toml +1 -1
  4. tars_cli-0.1.5/tars_cli/__init__.py +1 -0
  5. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/hints.py +7 -7
  6. tars_cli-0.1.5/tars_cli.egg-info/PKG-INFO +267 -0
  7. tars_cli-0.1.4/PKG-INFO +0 -259
  8. tars_cli-0.1.4/README.md +0 -239
  9. tars_cli-0.1.4/tars_cli/__init__.py +0 -1
  10. tars_cli-0.1.4/tars_cli.egg-info/PKG-INFO +0 -259
  11. {tars_cli-0.1.4 → tars_cli-0.1.5}/setup.cfg +0 -0
  12. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/__main__.py +0 -0
  13. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/app.py +0 -0
  14. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/auth.py +0 -0
  15. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/client.py +0 -0
  16. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/commands/__init__.py +0 -0
  17. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/commands/auth_cmd.py +0 -0
  18. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/commands/dataset_cmd.py +0 -0
  19. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/commands/eval_cmd.py +0 -0
  20. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/commands/plugin_cmd.py +0 -0
  21. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/commands/template_cmd.py +0 -0
  22. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/config.py +0 -0
  23. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/output.py +0 -0
  24. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/utils/__init__.py +0 -0
  25. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/utils/polling.py +0 -0
  26. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli/utils/progress.py +0 -0
  27. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli.egg-info/SOURCES.txt +0 -0
  28. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli.egg-info/dependency_links.txt +0 -0
  29. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli.egg-info/entry_points.txt +0 -0
  30. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli.egg-info/requires.txt +0 -0
  31. {tars_cli-0.1.4 → tars_cli-0.1.5}/tars_cli.egg-info/top_level.txt +0 -0
  32. {tars_cli-0.1.4 → tars_cli-0.1.5}/tests/test_auth.py +0 -0
  33. {tars_cli-0.1.4 → tars_cli-0.1.5}/tests/test_client.py +0 -0
  34. {tars_cli-0.1.4 → tars_cli-0.1.5}/tests/test_config.py +0 -0
  35. {tars_cli-0.1.4 → tars_cli-0.1.5}/tests/test_hints.py +0 -0
  36. {tars_cli-0.1.4 → tars_cli-0.1.5}/tests/test_output.py +0 -0
@@ -0,0 +1,267 @@
1
+ Metadata-Version: 2.4
2
+ Name: tars-cli
3
+ Version: 0.1.5
4
+ Summary: tars 平台命令行工具
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: typer>=0.12
8
+ Requires-Dist: httpx>=0.27
9
+ Requires-Dist: rich>=13.0
10
+ Requires-Dist: pyyaml>=6.0
11
+ Requires-Dist: platformdirs>=4.0
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8.0; extra == "dev"
14
+ Requires-Dist: pytest-mock>=3.12; extra == "dev"
15
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
16
+ Requires-Dist: respx>=0.21; extra == "dev"
17
+ Requires-Dist: mypy>=1.8; extra == "dev"
18
+ Requires-Dist: ruff>=0.3; extra == "dev"
19
+ Requires-Dist: build>=1.0; extra == "dev"
20
+
21
+ # tars-cli
22
+
23
+ tars 平台命令行工具,支持插件导入、数据集管理、评估执行和报告导出。
24
+
25
+ ## 安装
26
+
27
+ ```bash
28
+ pip install tars-cli
29
+ ```
30
+
31
+ ### 安装验证
32
+
33
+ ```bash
34
+ $ tars --version
35
+ tars-cli 0.1.5
36
+ ```
37
+
38
+ ### 升级
39
+
40
+ ```bash
41
+ pip install --upgrade tars-cli
42
+ ```
43
+
44
+ ### 环境要求
45
+
46
+ - Python >= 3.11
47
+ - 依赖:typer >= 0.12, httpx >= 0.27, rich >= 13.0, pyyaml >= 6.0, platformdirs >= 4.0
48
+
49
+ ## 快速开始
50
+
51
+ ```bash
52
+ # 登录
53
+ tars auth login -s <server_url>
54
+
55
+ # 导入插件
56
+ tars plugin import <git_url>
57
+
58
+ # 智能生成数据集并执行评估
59
+ tars dataset generate <plugin_id> --agent-name <name>
60
+ tars eval run <plugin_id> --agent-name <name> --dataset-version <version_id>
61
+
62
+ # 导出测评报告
63
+ tars plugin export-report <plugin_id>
64
+ ```
65
+
66
+ ## 命令测试结果
67
+
68
+ ### 认证
69
+
70
+ ```bash
71
+ $ tars auth login -s <server_url>
72
+ 登录 tars 平台
73
+ 用户名: admin
74
+ 密码: ********
75
+ ✓ 登录成功
76
+ 服务器: <server_url>
77
+ 用户: admin
78
+
79
+ $ tars auth logout
80
+ ✓ 已登出,本地凭证已清除
81
+ ```
82
+
83
+ ### 插件管理
84
+
85
+ ```bash
86
+ $ tars plugin import https://github.com/org/repo.git
87
+ ✓ 插件验证通过
88
+ ✓ Plugin 导入成功
89
+
90
+ $ tars plugin import /path/to/plugin.zip --overwrite
91
+ ✓ 插件验证通过
92
+ ✓ Plugin 导入成功(已覆盖)
93
+
94
+ $ tars plugin export-report <plugin_id>
95
+ message: 报告导出成功
96
+ path: /path/to/report_<plugin_id>_<timestamp>.html
97
+ ```
98
+
99
+ ### 模板下载
100
+
101
+ ```bash
102
+ $ tars template download plan -f yaml
103
+ ✓ 模板已下载
104
+ 文件: plan-template.yaml
105
+
106
+ $ tars template download testcase-single
107
+ ✓ 模板已下载
108
+ 文件: testcase-single-template.yaml
109
+
110
+ $ tars template download testcase-multi
111
+ ✓ 模板已下载
112
+ 文件: testcase-multi-template.yaml
113
+ ```
114
+
115
+ ### 数据集管理
116
+
117
+ > `--agent-name` 和 `--skill-name` 二选一,必须指定其中一个。`publish` 仅需版本 ID,无需指定目标。
118
+ >
119
+ > `--conversation-type`(简写 `-t`)支持 `single_turn`(默认)和 `multi_turn`,用于指定会话类型。
120
+
121
+ #### 按 Agent 生成 & 管理
122
+
123
+ ```bash
124
+ $ tars dataset generate <plugin_id> --agent-name <name> --conversation-type single_turn
125
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:03:56
126
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:04:47
127
+
128
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/golden-set/<version_id>
129
+ 👉 下一步: tars dataset publish <version_id>
130
+ version_id: <version_id>
131
+ status: draft
132
+ case_count:
133
+ message: 数据集生成完成
134
+
135
+ $ tars dataset list <plugin_id> --agent-name <name> --conversation-type single_turn
136
+ 数据集版本列表
137
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
138
+ ┃ 版本 ID ┃ 状态 ┃ 用例数 ┃ 创建时间 ┃
139
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
140
+ │ <version_id> │ published│ N │ <datetime> │
141
+ │ <version_id> │ draft │ N │ <datetime> │
142
+ └────────────────────────────────────┴──────────┴────────┴────────────────────┘
143
+ ```
144
+
145
+ #### 按 Skill 生成 & 管理
146
+
147
+ ```bash
148
+ $ tars dataset generate <plugin_id> --skill-name <name> --conversation-type multi_turn
149
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:03:56
150
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:04:47
151
+
152
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/golden-set/<version_id>
153
+ 👉 下一步: tars dataset publish <version_id>
154
+ version_id: <version_id>
155
+ status: draft
156
+ case_count:
157
+ message: 数据集生成完成
158
+
159
+ $ tars dataset list <plugin_id> --skill-name <name> --conversation-type multi_turn
160
+ 数据集版本列表
161
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
162
+ ┃ 版本 ID ┃ 状态 ┃ 用例数 ┃ 创建时间 ┃
163
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
164
+ │ <version_id> │ published│ N │ <datetime> │
165
+ └────────────────────────────────────┴──────────┴────────┴────────────────────┘
166
+ ```
167
+
168
+ #### 发布数据集版本
169
+
170
+ ```bash
171
+ $ tars dataset publish <version_id>
172
+ version_id: <version_id>
173
+ status: published
174
+ message: 发布成功
175
+ ```
176
+
177
+ ### 评估
178
+
179
+ > `--agent-name` 和 `--skill-name` 二选一,可不传。`eval status` 仅需任务 ID。
180
+
181
+ #### 按 Agent 评估
182
+
183
+ ```bash
184
+ $ tars eval run <plugin_id> --agent-name <name> --dataset-version <version_id>
185
+ 任务已创建: <task_id>
186
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:07:13
187
+
188
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/evaluation/<task_id>
189
+ 👉 下一步: tars plugin export-report <plugin_id>
190
+ task_id: <task_id>
191
+ status: completed
192
+ score: <score>
193
+ pass_rate: <rate>
194
+ message: 评估完成
195
+
196
+ $ tars eval run <plugin_id> --agent-name <name> --dataset-version <version_id> --threshold 0.8
197
+ 任务已创建: <task_id>
198
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:07:13
199
+
200
+ task_id: <task_id>
201
+ status: completed
202
+ score: <score>
203
+ pass_rate: <rate>
204
+ message: 评估完成
205
+ (退出码为 1,评分低于阈值)
206
+ ```
207
+
208
+ #### 按 Skill 评估
209
+
210
+ ```bash
211
+ $ tars eval run <plugin_id> --skill-name <name> --dataset-version <version_id>
212
+ 任务已创建: <task_id>
213
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:07:13
214
+
215
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/evaluation/<task_id>
216
+ 👉 下一步: tars plugin export-report <plugin_id>
217
+ task_id: <task_id>
218
+ status: completed
219
+ score: <score>
220
+ pass_rate: <rate>
221
+ message: 评估完成
222
+ ```
223
+
224
+ #### 查看评估状态
225
+
226
+ ```bash
227
+ $ tars eval status <task_id>
228
+ task_id: <task_id>
229
+ status: completed
230
+ overall_score: <score>
231
+ total_cases: <N>
232
+ passed_cases: <N>
233
+ failed_cases: <N>
234
+ ```
235
+
236
+ ## 全局选项
237
+
238
+ | 选项 | 说明 |
239
+ |------|------|
240
+ | `-o, --output FORMAT` | 输出格式:`table`(默认)/ `json` / `yaml` |
241
+ | `-q, --quiet` | 安静模式 |
242
+ | `--verbose` | 打印 HTTP 请求日志 |
243
+ | `--server URL` | 覆盖服务地址(优先级:`--server` > `TARS_SERVER_URL` 环境变量 > 默认 `http://localhost:8001`) |
244
+ | `-V, --version` | 查看版本 |
245
+
246
+ ## CI/CD 集成
247
+
248
+ ```bash
249
+ export TARS_ACCESS_TOKEN=<token>
250
+ export TARS_SERVER_URL=https://your-tars-server.com
251
+
252
+ tars eval run <plugin_id> \
253
+ --agent-name <name> \
254
+ --dataset-version <version_id> \
255
+ --threshold 0.8 \
256
+ -o json -q
257
+ ```
258
+
259
+ 评分低于阈值时退出码为 1,可用于流水线门禁。
260
+
261
+ ## 退出码
262
+
263
+ | 退出码 | 含义 |
264
+ |--------|------|
265
+ | 0 | 成功 / 评估通过 |
266
+ | 1 | 评估未通过(评分低于 `--threshold`) |
267
+ | 2 | 执行错误(网络、参数、认证等) |
@@ -0,0 +1,247 @@
1
+ # tars-cli
2
+
3
+ tars 平台命令行工具,支持插件导入、数据集管理、评估执行和报告导出。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pip install tars-cli
9
+ ```
10
+
11
+ ### 安装验证
12
+
13
+ ```bash
14
+ $ tars --version
15
+ tars-cli 0.1.5
16
+ ```
17
+
18
+ ### 升级
19
+
20
+ ```bash
21
+ pip install --upgrade tars-cli
22
+ ```
23
+
24
+ ### 环境要求
25
+
26
+ - Python >= 3.11
27
+ - 依赖:typer >= 0.12, httpx >= 0.27, rich >= 13.0, pyyaml >= 6.0, platformdirs >= 4.0
28
+
29
+ ## 快速开始
30
+
31
+ ```bash
32
+ # 登录
33
+ tars auth login -s <server_url>
34
+
35
+ # 导入插件
36
+ tars plugin import <git_url>
37
+
38
+ # 智能生成数据集并执行评估
39
+ tars dataset generate <plugin_id> --agent-name <name>
40
+ tars eval run <plugin_id> --agent-name <name> --dataset-version <version_id>
41
+
42
+ # 导出测评报告
43
+ tars plugin export-report <plugin_id>
44
+ ```
45
+
46
+ ## 命令测试结果
47
+
48
+ ### 认证
49
+
50
+ ```bash
51
+ $ tars auth login -s <server_url>
52
+ 登录 tars 平台
53
+ 用户名: admin
54
+ 密码: ********
55
+ ✓ 登录成功
56
+ 服务器: <server_url>
57
+ 用户: admin
58
+
59
+ $ tars auth logout
60
+ ✓ 已登出,本地凭证已清除
61
+ ```
62
+
63
+ ### 插件管理
64
+
65
+ ```bash
66
+ $ tars plugin import https://github.com/org/repo.git
67
+ ✓ 插件验证通过
68
+ ✓ Plugin 导入成功
69
+
70
+ $ tars plugin import /path/to/plugin.zip --overwrite
71
+ ✓ 插件验证通过
72
+ ✓ Plugin 导入成功(已覆盖)
73
+
74
+ $ tars plugin export-report <plugin_id>
75
+ message: 报告导出成功
76
+ path: /path/to/report_<plugin_id>_<timestamp>.html
77
+ ```
78
+
79
+ ### 模板下载
80
+
81
+ ```bash
82
+ $ tars template download plan -f yaml
83
+ ✓ 模板已下载
84
+ 文件: plan-template.yaml
85
+
86
+ $ tars template download testcase-single
87
+ ✓ 模板已下载
88
+ 文件: testcase-single-template.yaml
89
+
90
+ $ tars template download testcase-multi
91
+ ✓ 模板已下载
92
+ 文件: testcase-multi-template.yaml
93
+ ```
94
+
95
+ ### 数据集管理
96
+
97
+ > `--agent-name` 和 `--skill-name` 二选一,必须指定其中一个。`publish` 仅需版本 ID,无需指定目标。
98
+ >
99
+ > `--conversation-type`(简写 `-t`)支持 `single_turn`(默认)和 `multi_turn`,用于指定会话类型。
100
+
101
+ #### 按 Agent 生成 & 管理
102
+
103
+ ```bash
104
+ $ tars dataset generate <plugin_id> --agent-name <name> --conversation-type single_turn
105
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:03:56
106
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:04:47
107
+
108
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/golden-set/<version_id>
109
+ 👉 下一步: tars dataset publish <version_id>
110
+ version_id: <version_id>
111
+ status: draft
112
+ case_count:
113
+ message: 数据集生成完成
114
+
115
+ $ tars dataset list <plugin_id> --agent-name <name> --conversation-type single_turn
116
+ 数据集版本列表
117
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
118
+ ┃ 版本 ID ┃ 状态 ┃ 用例数 ┃ 创建时间 ┃
119
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
120
+ │ <version_id> │ published│ N │ <datetime> │
121
+ │ <version_id> │ draft │ N │ <datetime> │
122
+ └────────────────────────────────────┴──────────┴────────┴────────────────────┘
123
+ ```
124
+
125
+ #### 按 Skill 生成 & 管理
126
+
127
+ ```bash
128
+ $ tars dataset generate <plugin_id> --skill-name <name> --conversation-type multi_turn
129
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:03:56
130
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:04:47
131
+
132
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/golden-set/<version_id>
133
+ 👉 下一步: tars dataset publish <version_id>
134
+ version_id: <version_id>
135
+ status: draft
136
+ case_count:
137
+ message: 数据集生成完成
138
+
139
+ $ tars dataset list <plugin_id> --skill-name <name> --conversation-type multi_turn
140
+ 数据集版本列表
141
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
142
+ ┃ 版本 ID ┃ 状态 ┃ 用例数 ┃ 创建时间 ┃
143
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
144
+ │ <version_id> │ published│ N │ <datetime> │
145
+ └────────────────────────────────────┴──────────┴────────┴────────────────────┘
146
+ ```
147
+
148
+ #### 发布数据集版本
149
+
150
+ ```bash
151
+ $ tars dataset publish <version_id>
152
+ version_id: <version_id>
153
+ status: published
154
+ message: 发布成功
155
+ ```
156
+
157
+ ### 评估
158
+
159
+ > `--agent-name` 和 `--skill-name` 二选一,可不传。`eval status` 仅需任务 ID。
160
+
161
+ #### 按 Agent 评估
162
+
163
+ ```bash
164
+ $ tars eval run <plugin_id> --agent-name <name> --dataset-version <version_id>
165
+ 任务已创建: <task_id>
166
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:07:13
167
+
168
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/evaluation/<task_id>
169
+ 👉 下一步: tars plugin export-report <plugin_id>
170
+ task_id: <task_id>
171
+ status: completed
172
+ score: <score>
173
+ pass_rate: <rate>
174
+ message: 评估完成
175
+
176
+ $ tars eval run <plugin_id> --agent-name <name> --dataset-version <version_id> --threshold 0.8
177
+ 任务已创建: <task_id>
178
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:07:13
179
+
180
+ task_id: <task_id>
181
+ status: completed
182
+ score: <score>
183
+ pass_rate: <rate>
184
+ message: 评估完成
185
+ (退出码为 1,评分低于阈值)
186
+ ```
187
+
188
+ #### 按 Skill 评估
189
+
190
+ ```bash
191
+ $ tars eval run <plugin_id> --skill-name <name> --dataset-version <version_id>
192
+ 任务已创建: <task_id>
193
+ completed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:07:13
194
+
195
+ 📎 在 Web 端查看: <server_url>/plugins/<plugin_id>/evaluation/<task_id>
196
+ 👉 下一步: tars plugin export-report <plugin_id>
197
+ task_id: <task_id>
198
+ status: completed
199
+ score: <score>
200
+ pass_rate: <rate>
201
+ message: 评估完成
202
+ ```
203
+
204
+ #### 查看评估状态
205
+
206
+ ```bash
207
+ $ tars eval status <task_id>
208
+ task_id: <task_id>
209
+ status: completed
210
+ overall_score: <score>
211
+ total_cases: <N>
212
+ passed_cases: <N>
213
+ failed_cases: <N>
214
+ ```
215
+
216
+ ## 全局选项
217
+
218
+ | 选项 | 说明 |
219
+ |------|------|
220
+ | `-o, --output FORMAT` | 输出格式:`table`(默认)/ `json` / `yaml` |
221
+ | `-q, --quiet` | 安静模式 |
222
+ | `--verbose` | 打印 HTTP 请求日志 |
223
+ | `--server URL` | 覆盖服务地址(优先级:`--server` > `TARS_SERVER_URL` 环境变量 > 默认 `http://localhost:8001`) |
224
+ | `-V, --version` | 查看版本 |
225
+
226
+ ## CI/CD 集成
227
+
228
+ ```bash
229
+ export TARS_ACCESS_TOKEN=<token>
230
+ export TARS_SERVER_URL=https://your-tars-server.com
231
+
232
+ tars eval run <plugin_id> \
233
+ --agent-name <name> \
234
+ --dataset-version <version_id> \
235
+ --threshold 0.8 \
236
+ -o json -q
237
+ ```
238
+
239
+ 评分低于阈值时退出码为 1,可用于流水线门禁。
240
+
241
+ ## 退出码
242
+
243
+ | 退出码 | 含义 |
244
+ |--------|------|
245
+ | 0 | 成功 / 评估通过 |
246
+ | 1 | 评估未通过(评分低于 `--threshold`) |
247
+ | 2 | 执行错误(网络、参数、认证等) |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tars-cli"
7
- version = "0.1.4"
7
+ version = "0.1.5"
8
8
  description = "tars 平台命令行工具"
9
9
  requires-python = ">=3.11"
10
10
  dependencies = [
@@ -0,0 +1 @@
1
+ __version__ = "0.1.5"
@@ -4,13 +4,13 @@ import typer
4
4
 
5
5
  ROUTE_MAP: dict[str, str] = {
6
6
  "plugin_import": "/plugins/{plugin_id}",
7
- "plugin_report": "/plugins/{plugin_id}/report",
8
- "dataset_version": "/plugins/{plugin_id}/datasets/{version_id}",
9
- "dataset_generate": "/plugins/{plugin_id}/datasets/{version_id}",
10
- "dataset_upload": "/plugins/{plugin_id}/datasets/{version_id}",
11
- "dataset_publish": "/plugins/{plugin_id}/datasets/{version_id}",
12
- "eval_task": "/plugins/{plugin_id}/evaluations/{task_id}",
13
- "eval_run": "/plugins/{plugin_id}/evaluations/{task_id}",
7
+ "plugin_report": "",
8
+ "dataset_version": "/plugins/{plugin_id}/golden-set/{version_id}",
9
+ "dataset_generate": "/plugins/{plugin_id}/golden-set/{version_id}",
10
+ "dataset_upload": "/plugins/{plugin_id}/golden-set/{version_id}",
11
+ "dataset_publish": "/plugins/{plugin_id}/golden-set/{version_id}",
12
+ "eval_task": "/plugins/{plugin_id}/evaluation/{task_id}",
13
+ "eval_run": "/plugins/{plugin_id}/evaluation/{task_id}",
14
14
  }
15
15
 
16
16
  NEXT_STEP_MAP: dict[str, str] = {