Skip to content

Agent 与对话命令

Agent 管理

agent:list

列出所有 Agent。

参数:

参数类型必填说明
pagenumber页码,默认 1
pageSizenumber每页条数,默认 20,最大 100
querystring搜索关键词
enabledboolean按启用状态筛选

请求示例:

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 详情。

参数:

参数类型必填说明
agentIdstringAgent 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。

参数:

参数类型必填说明
namestringAgent 名称
descriptionstringAgent 描述
instructionsstring系统指令
modelstring使用的模型
temperaturenumber温度参数,范围 0-2
enabledboolean是否启用,默认 true
tagsstring[]标签列表
workingDirectorystring工作目录

请求示例:

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。

参数:

参数类型必填说明
agentIdstringAgent ID
namestringAgent 名称
descriptionstringAgent 描述
instructionsstring系统指令
modelstring使用的模型
temperaturenumber温度参数

请求示例:

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。

参数:

参数类型必填说明
agentIdstringAgent ID

请求示例:

bash
workova agent:delete --input '{"agentId": "agent_abc"}'

返回示例:

json
{
  "success": true,
  "data": {
    "agentId": "agent_abc",
    "deleted": true
  }
}

agent:tools

查看 Agent 已绑定的工具。

参数:

参数类型必填说明
agentIdstringAgent 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。

参数:

参数类型必填说明
agentIdstringAgent ID
skillNamestringSkill 名称
modestring绑定模式,可选 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。

参数:

参数类型必填说明
agentIdstringAgent ID
skillNamestringSkill 名称

请求示例:

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

创建对话。

参数:

参数类型必填说明
titlestring对话标题
agentIdstring关联的 Agent ID
systemPromptstring系统提示词

请求示例:

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

列出对话。

参数:

参数类型必填说明
pagenumber页码
pageSizenumber每页条数
querystring搜索关键词
agentIdstring按 Agent ID 筛选
statusstring按状态筛选,可选 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

查看对话历史。

参数:

参数类型必填说明
conversationIdstring对话 ID
limitnumber返回条数,默认 50,最大 200
beforeMessageIdstring获取此消息之前的历史
afterMessageIdstring获取此消息之后的历史

请求示例:

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

删除对话。

参数:

参数类型必填说明
conversationIdstring对话 ID

请求示例:

bash
workova conversation:delete --input '{"conversationId": "conv_123"}'

返回示例:

json
{
  "success": true,
  "data": {
    "conversationId": "conv_123",
    "deleted": true
  }
}

发送消息

chat:send

发送消息并等待回复。

参数:

参数类型必填说明
messagestring消息内容
conversationIdstring对话 ID,不传则创建新对话
agentIdstringAgent 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

启动异步运行。

参数:

参数类型必填说明
taskstring任务描述
agentIdstringAgent ID,默认使用 default
conversationIdstring对话 ID
streamboolean是否启用流式输出,默认 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

获取运行事件流。

参数:

参数类型必填说明
runIdstring运行 ID
afterEventIdstring从指定事件之后开始获取

请求示例:

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

持续输出事件直到运行完成。

参数:

参数类型必填说明
runIdstring运行 ID

请求示例:

bash
workova run:follow --input '{"runId": "run_456"}'

持续输出事件流,类似 docker logs -f 行为,直到运行状态变为 completedfailed

输入方式

所有接受结构化参数的命令支持两种输入方式:

bash
# 内联 JSON
workova agent:create --input '{"name": "my-agent"}'

# 从文件读取
workova agent:create --input-file ./config.json

WARNING

--input--input-file 互斥,不可同时使用。

Workova 官方文档