|
| 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. |
0 commit comments