Skip to content

Commit a861ede

Browse files
docs(cli): add Harness command reference (zh/en) (#599)
Document the `veadk agentkit harness add` / `invoke` client commands for a deployed Harness server: connection options (--url/--key, HARNESS_URL/ HARNESS_KEY/HARNESS_TIMEOUT), full option tables, and the one-time harness override on invoke. Wire the new page into the CLI nav (meta + index cards), bilingual.
1 parent 75914ca commit a861ede

6 files changed

Lines changed: 201 additions & 2 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: "Harness Commands"
3+
description: "Register and invoke harnesses (agent specs) on a deployed Harness server from the CLI."
4+
---
5+
6+
`veadk agentkit harness` is a thin set of HTTP client commands for a deployed
7+
**Harness server** (`veadk.cloud.harness_app`).
8+
9+
A *harness* is a named agent spec — **model + system prompt + tools + skills**.
10+
The Harness server exposes `/harness/add` and `/harness/invoke`, letting you
11+
register and invoke harnesses at runtime without redeploying.
12+
13+
<Callout type="info">
14+
Before you start, deploy the Harness server to Volcengine AgentKit (see the
15+
[`14_harness_server_on_agentkit`](https://github.com/volcengine/veadk-python/tree/main/examples/14_harness_server_on_agentkit)
16+
example) and grab its **endpoint URL** and gateway **API key**.
17+
</Callout>
18+
19+
## Command reference
20+
21+
| Command | Description |
22+
| :-- | :-- |
23+
| `veadk agentkit harness add` | Register a new harness on the server. |
24+
| `veadk agentkit harness invoke` | Invoke a harness and print its output. |
25+
26+
## Connection options
27+
28+
Both commands need the server address and auth, supplied via options or
29+
environment variables:
30+
31+
| Option | Env var | Description |
32+
| :-- | :-- | :-- |
33+
| `--url` | `HARNESS_URL` | Harness server base URL (required). |
34+
| `--key` | `HARNESS_KEY` | Gateway API key for Bearer auth (optional). |
35+
| — | `HARNESS_TIMEOUT` | Client request timeout in seconds, default `600` (agent runs can be slow). |
36+
37+
## `harness add`
38+
39+
Register a named harness on the server.
40+
41+
```bash
42+
veadk agentkit harness add \
43+
--name research-agent \
44+
--model-name doubao-seed-1-6-250615 \
45+
--system-prompt "You are a research assistant." \
46+
--tools web_search,web_fetch \
47+
--url "<ENDPOINT>" --key "<API_KEY>"
48+
```
49+
50+
| Option | Required | Description |
51+
| :-- | :-- | :-- |
52+
| `--name` | Yes | Harness (agent) name. |
53+
| `--model-name` | No | Model name; defaults to the server's `MODEL_AGENT_NAME`. |
54+
| `--system-prompt` | No | System prompt; defaults to `You are a helpful assistant.`. |
55+
| `--tools` | No | Comma-separated built-in tool names, e.g. `web_search,web_fetch`. |
56+
| `--skills` | No | Comma-separated skill hub names, e.g. `clawhub/lgwventrue/system-file-handler`. |
57+
58+
<Callout type="warn">
59+
If a harness with the same name already exists, the server returns `code: 400`
60+
and does not overwrite it.
61+
</Callout>
62+
63+
## `harness invoke`
64+
65+
Invoke an **already-registered** harness and print its output. The message is a
66+
positional argument.
67+
68+
```bash
69+
veadk agentkit harness invoke \
70+
--harness research-agent \
71+
--url "<ENDPOINT>" --key "<API_KEY>" \
72+
"Summarize the latest on reinforcement learning."
73+
```
74+
75+
| Option | Required | Description |
76+
| :-- | :-- | :-- |
77+
| `MESSAGE` (positional) | Yes | The message to send to the harness. |
78+
| `--harness` | Yes | Harness name to invoke. |
79+
| `--user-id` | No | User id for the session, default `cli-user`. |
80+
| `--session-id` | No | Session id for the call, default `cli-session`. |
81+
| `--model-name` | No | Override the model for this call only (creates a one-time harness). |
82+
| `--system-prompt` | No | Override the system prompt for this call only (creates a one-time harness). |
83+
| `--tools` | No | Override tools for this call only, comma-separated (creates a one-time harness). |
84+
| `--skills` | No | Override skills for this call only, comma-separated (creates a one-time harness). |
85+
86+
### One-time harness override
87+
88+
If any of `--model-name` / `--system-prompt` / `--tools` / `--skills` is passed
89+
to `invoke`, the server builds a **one-time harness** from those fields that
90+
applies to this single call only — the stored harness of the same name is left
91+
untouched:
92+
93+
```bash
94+
veadk agentkit harness invoke \
95+
--harness research-agent \
96+
--system-prompt "Answer in one sentence." \
97+
--url "<ENDPOINT>" --key "<API_KEY>" \
98+
"What is reinforcement learning?"
99+
```
100+
101+
## Full example
102+
103+
For the end-to-end deploy-and-invoke flow (including the `curl` equivalents),
104+
see the [`14_harness_server_on_agentkit`](https://github.com/volcengine/veadk-python/tree/main/examples/14_harness_server_on_agentkit)
105+
example.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: "Harness 命令"
3+
description: "通过命令行注册并调用部署在 Harness server 上的 harness(智能体规格)。"
4+
---
5+
6+
`veadk agentkit harness` 是一组轻量的 HTTP 客户端命令,用于操作已部署的 **Harness server**(`veadk.cloud.harness_app`)。
7+
8+
一个 *harness* 就是一份具名的智能体规格 —— **模型 + 系统提示词 + 工具 + 技能**。Harness server 暴露 `/harness/add` 与 `/harness/invoke` 两个接口,让你在运行时动态注册并调用 harness,无需重新部署。
9+
10+
<Callout type="info">
11+
使用前需先把 Harness server 部署到火山引擎 AgentKit(参见示例 [`14_harness_server_on_agentkit`](https://github.com/volcengine/veadk-python/tree/main/examples/14_harness_server_on_agentkit)),并拿到服务的 **Endpoint URL** 与网关 **API Key**。
12+
</Callout>
13+
14+
## 命令一览
15+
16+
| 命令 | 描述 |
17+
| :-- | :-- |
18+
| `veadk agentkit harness add` | 在服务端注册一个新的 harness。 |
19+
| `veadk agentkit harness invoke` | 调用一个 harness 并打印输出。 |
20+
21+
## 连接参数
22+
23+
两个命令都需要指定 Harness server 的地址与鉴权,可通过命令行选项或环境变量提供:
24+
25+
| 选项 | 环境变量 | 说明 |
26+
| :-- | :-- | :-- |
27+
| `--url` | `HARNESS_URL` | Harness server 的基础 URL(必填)。 |
28+
| `--key` | `HARNESS_KEY` | 网关 API Key,用于 Bearer 鉴权(可选)。 |
29+
| — | `HARNESS_TIMEOUT` | 客户端请求超时秒数,默认 `600`(智能体执行可能耗时较长)。 |
30+
31+
## `harness add`
32+
33+
在服务端注册一个具名 harness。
34+
35+
```bash
36+
veadk agentkit harness add \
37+
--name research-agent \
38+
--model-name doubao-seed-1-6-250615 \
39+
--system-prompt "You are a research assistant." \
40+
--tools web_search,web_fetch \
41+
--url "<ENDPOINT>" --key "<API_KEY>"
42+
```
43+
44+
| 选项 | 必填 | 说明 |
45+
| :-- | :-- | :-- |
46+
| `--name` | 是 | harness(智能体)名称。 |
47+
| `--model-name` | 否 | 模型名称,缺省使用服务端的 `MODEL_AGENT_NAME`。 |
48+
| `--system-prompt` | 否 | 系统提示词,默认 `You are a helpful assistant.`。 |
49+
| `--tools` | 否 | 逗号分隔的内置工具名,如 `web_search,web_fetch`。 |
50+
| `--skills` | 否 | 逗号分隔的技能 hub 名,如 `clawhub/lgwventrue/system-file-handler`。 |
51+
52+
<Callout type="warn">
53+
若同名 harness 已存在,服务端返回 `code: 400`,不会覆盖。
54+
</Callout>
55+
56+
## `harness invoke`
57+
58+
调用一个**已注册**的 harness,并打印其输出。消息作为位置参数传入。
59+
60+
```bash
61+
veadk agentkit harness invoke \
62+
--harness research-agent \
63+
--url "<ENDPOINT>" --key "<API_KEY>" \
64+
"总结一下强化学习的最新进展。"
65+
```
66+
67+
| 选项 | 必填 | 说明 |
68+
| :-- | :-- | :-- |
69+
| `MESSAGE`(位置参数) | 是 | 发送给 harness 的消息。 |
70+
| `--harness` | 是 | 要调用的 harness 名称。 |
71+
| `--user-id` | 否 | 会话所属用户 id,默认 `cli-user`。 |
72+
| `--session-id` | 否 | 本次调用的会话 id,默认 `cli-session`。 |
73+
| `--model-name` | 否 | 仅本次调用覆盖模型(生成一次性 harness)。 |
74+
| `--system-prompt` | 否 | 仅本次调用覆盖系统提示词(生成一次性 harness)。 |
75+
| `--tools` | 否 | 仅本次调用覆盖工具,逗号分隔(生成一次性 harness)。 |
76+
| `--skills` | 否 | 仅本次调用覆盖技能,逗号分隔(生成一次性 harness)。 |
77+
78+
### 一次性 harness 覆盖
79+
80+
`invoke` 时若提供了 `--model-name` / `--system-prompt` / `--tools` / `--skills` 中的任意一个,服务端会用这些字段构造一个**一次性 harness**,仅对本次调用生效,不影响已注册的同名 harness:
81+
82+
```bash
83+
veadk agentkit harness invoke \
84+
--harness research-agent \
85+
--system-prompt "只用一句话回答。" \
86+
--url "<ENDPOINT>" --key "<API_KEY>" \
87+
"什么是强化学习?"
88+
```
89+
90+
## 完整示例
91+
92+
端到端的部署与调用流程(含 `curl` 等价写法)参见示例 [`14_harness_server_on_agentkit`](https://github.com/volcengine/veadk-python/tree/main/examples/14_harness_server_on_agentkit)。

‎docs/content/docs/cli/index.en.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ veadk --help
1212
<Cards>
1313
<Card title="VeADK CLI" href="/en/docs/cli/veadk-cli" description="Full reference for init, create, web, kb, deploy, eval, prompt, uploadevalset, pipeline, and more." />
1414
<Card title="AgentKit compatibility" href="/en/docs/cli/agentkit-cli" description="Reuse the AgentKit workflow through veadk agentkit." />
15+
<Card title="Harness commands" href="/en/docs/cli/harness-cli" description="Register and invoke harnesses on a deployed Harness server." />
1516
</Cards>

‎docs/content/docs/cli/index.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ veadk --help
1212
<Cards>
1313
<Card title="VeADK CLI" href="/cn/docs/cli/veadk-cli" description="init、create、web、kb、deploy、eval、prompt、uploadevalset、pipeline 等命令的完整参考。" />
1414
<Card title="AgentKit 命令兼容" href="/cn/docs/cli/agentkit-cli" description="通过 veadk agentkit 复用 AgentKit 工作流。" />
15+
<Card title="Harness 命令" href="/cn/docs/cli/harness-cli" description="注册并调用部署在 Harness server 上的 harness。" />
1516
</Cards>

‎docs/content/docs/cli/meta.en.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"title": "CLI",
33
"icon": "Terminal",
44
"root": true,
5-
"pages": ["index", "veadk-cli", "agentkit-cli"]
5+
"pages": ["index", "veadk-cli", "agentkit-cli", "harness-cli"]
66
}

‎docs/content/docs/cli/meta.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"title": "命令行工具",
33
"icon": "Terminal",
44
"root": true,
5-
"pages": ["index", "veadk-cli", "agentkit-cli"]
5+
"pages": ["index", "veadk-cli", "agentkit-cli", "harness-cli"]
66
}

0 commit comments

Comments
 (0)