Appearance
Agent 与对话命令
Agent 管理
agent:list
列出所有 Agent。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| page | number | 否 | 页码,默认 1 |
| pageSize | number | 否 | 每页条数,默认 20,最大 100 |
| query | string | 否 | 搜索关键词 |
| enabled | boolean | 否 | 按启用状态筛选 |
请求示例:
bash
workova agent:list --input '{"page": 1, "pageSize": 20}'返回示例:
json
{
"success": true,
"data": {
"items": [
{
"id": "agent_abc",
"name": "code-reviewer",
"model": "claude-3",
"enabled": true
},
{
"id": "agent_def",
"name": "translator",
"model": "claude-3",
"enabled": false
}
],
"page": { "total": 2, "hasMore": false }
}
}agent:get
获取单个 Agent 详情。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| agentId | string | 是 | Agent ID |
请求示例:
bash
workova agent:get --input '{"agentId": "agent_abc"}'返回示例:
json
{
"success": true,
"data": {
"agent": {
"id": "agent_abc",
"name": "code-reviewer",
"description": "Code review assistant",
"model": "claude-3",
"systemPrompt": "You are a code review assistant.",
"temperature": 0.7,
"maxTokens": 4096
}
}
}agent:create
创建 Agent。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| name | string | 是 | Agent 名称 |
| description | string | 否 | Agent 描述 |
| instructions | string | 否 | 系统指令 |
| model | string | 否 | 使用的模型 |
| temperature | number | 否 | 温度参数,范围 0-2 |
| enabled | boolean | 否 | 是否启用,默认 true |
| tags | string[] | 否 | 标签列表 |
| workingDirectory | string | 否 | 工作目录 |
请求示例:
bash
workova agent:create --input '{"name": "code-reviewer", "model": "claude-3", "instructions": "You are a code review assistant.", "temperature": 0.7}'返回示例:
json
{
"success": true,
"data": {
"agent": {
"id": "agent_abc",
"name": "code-reviewer",
"description": "",
"model": "claude-3",
"systemPrompt": "You are a code review assistant.",
"temperature": 0.7,
"maxTokens": 4096
}
}
}agent:update
更新 Agent。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| agentId | string | 是 | Agent ID |
| name | string | 否 | Agent 名称 |
| description | string | 否 | Agent 描述 |
| instructions | string | 否 | 系统指令 |
| model | string | 否 | 使用的模型 |
| temperature | number | 否 | 温度参数 |
请求示例:
bash
workova agent:update --input '{"agentId": "agent_abc", "name": "updated-reviewer"}'返回示例:
json
{
"success": true,
"data": {
"agent": {
"id": "agent_abc",
"name": "updated-reviewer",
"model": "claude-3",
"systemPrompt": "You are a code review assistant.",
"temperature": 0.7,
"maxTokens": 4096
}
}
}agent:delete
删除 Agent。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| agentId | string | 是 | Agent ID |
请求示例:
bash
workova agent:delete --input '{"agentId": "agent_abc"}'返回示例:
json
{
"success": true,
"data": {
"agentId": "agent_abc",
"deleted": true
}
}agent:tools
查看 Agent 已绑定的工具。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| agentId | string | 是 | Agent ID |
请求示例:
bash
workova agent:tools --input '{"agentId": "agent_abc"}'返回示例:
json
{
"success": true,
"data": {
"agentId": "agent_abc",
"tools": ["file-reader", "code-search", "web-scraper"]
}
}agent:bind-skill
为 Agent 绑定 Skill。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| agentId | string | 是 | Agent ID |
| skillName | string | 是 | Skill 名称 |
| mode | string | 否 | 绑定模式,可选 summary_only / on_demand / always,默认 on_demand |
请求示例:
bash
workova agent:bind-skill --input '{"agentId": "agent_abc", "skillName": "web-scraper", "mode": "on_demand"}'返回示例:
json
{
"success": true,
"data": {
"agent": {
"id": "agent_abc",
"name": "code-reviewer",
"model": "claude-3"
}
}
}agent:unbind-skill
解绑 Skill。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| agentId | string | 是 | Agent ID |
| skillName | string | 是 | Skill 名称 |
请求示例:
bash
workova agent:unbind-skill --input '{"agentId": "agent_abc", "skillName": "web-scraper"}'返回示例:
json
{
"success": true,
"data": {
"agent": {
"id": "agent_abc",
"name": "code-reviewer",
"model": "claude-3"
}
}
}对话管理
conversation:create
创建对话。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| title | string | 否 | 对话标题 |
| agentId | string | 否 | 关联的 Agent ID |
| systemPrompt | string | 否 | 系统提示词 |
请求示例:
bash
workova conversation:create --input '{"agentId": "agent_abc", "title": "Code review session"}'返回示例:
json
{
"success": true,
"data": {
"conversation": {
"id": "conv_123",
"title": "Code review session",
"status": "active"
}
}
}conversation:list
列出对话。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| page | number | 否 | 页码 |
| pageSize | number | 否 | 每页条数 |
| query | string | 否 | 搜索关键词 |
| agentId | string | 否 | 按 Agent ID 筛选 |
| status | string | 否 | 按状态筛选,可选 open / closed |
请求示例:
bash
workova conversation:list --input '{"agentId": "agent_abc"}'返回示例:
json
{
"success": true,
"data": {
"items": [
{ "id": "conv_123", "title": "Code review session", "status": "active" },
{ "id": "conv_456", "title": "Bug analysis", "status": "closed" }
],
"page": { "total": 2, "hasMore": false }
}
}conversation:history
查看对话历史。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| conversationId | string | 是 | 对话 ID |
| limit | number | 否 | 返回条数,默认 50,最大 200 |
| beforeMessageId | string | 否 | 获取此消息之前的历史 |
| afterMessageId | string | 否 | 获取此消息之后的历史 |
请求示例:
bash
workova conversation:history --input '{"conversationId": "conv_123", "limit": 10}'返回示例:
json
{
"success": true,
"data": {
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Review this function",
"createdAt": "2026-03-30T08:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "Found 2 issues...",
"createdAt": "2026-03-30T08:00:05Z"
}
]
}
}conversation:delete
删除对话。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| conversationId | string | 是 | 对话 ID |
请求示例:
bash
workova conversation:delete --input '{"conversationId": "conv_123"}'返回示例:
json
{
"success": true,
"data": {
"conversationId": "conv_123",
"deleted": true
}
}发送消息
chat:send
发送消息并等待回复。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| message | string | 是 | 消息内容 |
| conversationId | string | 否 | 对话 ID,不传则创建新对话 |
| agentId | string | 否 | Agent ID |
请求示例:
bash
workova chat:send --input '{"conversationId": "conv_123", "message": "Review this code snippet"}'返回示例:
json
{
"success": true,
"data": {
"message": {
"id": "msg_003",
"role": "assistant",
"content": "I found 2 potential issues in the code..."
}
}
}TIP
chat:send 是同步命令,等待 Agent 完成回复后返回。长时间运行的任务建议使用 run:start + run:follow。
运行管理
run:start
启动异步运行。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| task | string | 是 | 任务描述 |
| agentId | string | 否 | Agent ID,默认使用 default |
| conversationId | string | 否 | 对话 ID |
| stream | boolean | 否 | 是否启用流式输出,默认 true |
请求示例:
bash
workova run:start --input '{"task": "Analyze the codebase for security issues", "agentId": "agent_abc"}'返回示例:
json
{
"success": true,
"data": {
"runId": "run_456",
"status": "running"
}
}run:events
获取运行事件流。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| runId | string | 是 | 运行 ID |
| afterEventId | string | 否 | 从指定事件之后开始获取 |
请求示例:
bash
workova run:events --input '{"runId": "run_456"}'返回示例:
json
{
"success": true,
"data": {
"type": "message",
"data": {
"id": "evt_001",
"content": "Starting security analysis..."
}
}
}事件类型:message(文本输出)、tool(工具调用)、completed(运行结束)。
run:follow
持续输出事件直到运行完成。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| runId | string | 是 | 运行 ID |
请求示例:
bash
workova run:follow --input '{"runId": "run_456"}'持续输出事件流,类似 docker logs -f 行为,直到运行状态变为 completed 或 failed。
输入方式
所有接受结构化参数的命令支持两种输入方式:
bash
# 内联 JSON
workova agent:create --input '{"name": "my-agent"}'
# 从文件读取
workova agent:create --input-file ./config.jsonWARNING
--input 和 --input-file 互斥,不可同时使用。