关于 cargo-ai
cargo-ai 是用于管理 Cargo AI Agent 资源的命令行技能,面向配置 Agent 的操作者。它涵盖 Agent、模板、版本发布、MCP 服务和记忆管理。
主要功能
- 01创建与配置 Agent
- 02浏览 Agent 模板
- 03管理版本草稿与发布
- 04配置编码 Agent 仓库
- 05管理 MCP 服务与记忆
适用场景
- 01从模板创建 Agent
- 02更新并部署 Agent 配置
- 03为编码 Agent 指定仓库
- 04查看和管理 MCP 服务
MCP 相关
此技能通过 cargo-ai 命令行管理 MCP 服务,并可在 Agent 版本配置中使用 MCP 客户端。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ getcargohq/ cargo-skills --skill cargo-ai安装后在 Claude Code 中输入/cargo-ai确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
skill-metadata.jsonreferences/response-shapes.mdtroubleshooting.mdreferences/examples/agents.mdmcp-servers.mdtemplates.md详细介绍
Cargo CLI — AI
Agent 资源管理:创建和配置 Agent、附加用于检索增强生成(RAG)的知识、连接 MCP 服务,以及管理 Agent 记忆。
如需使用 Agent(发送消息、多轮聊天、轮询),请使用
cargo-orchestration。 如需上传知识文件和构建知识库(content域),请使用cargo-content。本技能介绍如何将这些知识附加到 Agent。 如需管理工作区——文件夹(用于整理 Agent 和文件)、用户、API 令牌、角色,以及在 CLI 出错时提交报告——请使用cargo-workspace-management。
完整的 JSON 响应结构请参见
references/response-shapes.md。 常见错误及其修复方法请参见references/troubleshooting.md。 Agent CRUD 和配置示例请参见references/examples/agents.md。 MCP 服务创建和管理示例请参见references/examples/mcp-servers.md。
初始化
如果已经登录(cargo-ai whoami 返回工作区),请跳到下一节。
npm install -g @cargo-ai/cli # no global install? prefix every command with `npx @cargo-ai/cli`
cargo-ai login --email [email protected] # emailed code, no browser; creates the account on first use
# alternatives: --oauth (browser) · --token <api-token> (CI)
cargo-ai whoami # confirm the active workspace before any write
每条命令都会向 stdout 输出 JSON;失败时会以非零状态退出,并返回 {"errorMessage": "..."}。任何会创建运行任务或批次的操作都是异步的——请传入 --wait-until-finished,或轮询对应的 get 命令。安装完整技能包后,../cargo/references/prerequisites.md 会补充 CLI 版本固定要求、令牌范围和仅限管理员的操作。
先发现资源
cargo-ai ai agent list # all agents (uuid, name, description)
cargo-ai ai template list # all AI agent templates (slug, name)
cargo-ai ai mcp-server list # all MCP servers (uuid, name)
cargo-ai ai memory list --scope agent --agent-uuid <uuid> # agent memories
# Knowledge files & libraries live in the content domain — see cargo-content:
# cargo-ai content file list / cargo-ai content library list
在 UI 中查看: Agent 位于 app.getcargo.io/workspaces/<WORKSPACE_UUID>/agents/<AGENT_UUID>。从 cargo-ai whoami 的 workspace.uuid 获取 <WORKSPACE_UUID>。
快速参考
cargo-ai ai agent list
cargo-ai ai agent get <agent-uuid>
cargo-ai ai agent create --name <name> --icon-color blue --icon-face 🤖
cargo-ai ai agent update --uuid <agent-uuid> --name <name>
cargo-ai ai agent remove <agent-uuid>
cargo-ai ai release list --agent-uuid <uuid>
cargo-ai ai release get <release-uuid>
cargo-ai ai release get-draft --agent-uuid <uuid>
cargo-ai ai release update-draft --agent-uuid <uuid> --language-model-slug gpt-4o
cargo-ai ai release deploy-draft --agent-uuid <uuid>
cargo-ai ai template list # full detail; there is no `template get`
cargo-ai ai mcp-server list
cargo-ai ai mcp-server get <mcp-server-uuid>
cargo-ai ai mcp-server create --name "Internal Tools"
cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Updated Name"
cargo-ai ai mcp-server remove <mcp-server-uuid>
cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse
cargo-ai mcp # serve the platform MCP over stdio
cargo-ai mcp --server <mcp-server-uuid> # serve a curated workspace MCP server instead
cargo-ai ai memory list --scope agent --agent-uuid <uuid>
cargo-ai ai memory update --mem0-id <id> --scope agent --agent-uuid <uuid> --content "Updated memory"
cargo-ai ai memory remove --mem0-id <id> --scope agent --agent-uuid <uuid>
Agent
Agent 是 AI 资源,包含已配置的指令、语言模型、操作和可选资源。
从头创建 Agent 前,请先查看现有模板——它们包含适用于常见场景(潜在客户调研、分类、电子邮件起草)的成熟模式,并提供可直接使用的系统提示词、模型和温度设置:
cargo-ai ai template list # browse patterns — full detail, not a summary
# there is no `template get`: `list` already returns systemPrompt, temperature,
# languageModelSlug, actions and resources, so select the one you want
cargo-ai ai template list | jq '.templates[] | select(.slug == "<slug>")'
# List all agents
cargo-ai ai agent list
# Get a single agent (includes deployed release details)
cargo-ai ai agent get <agent-uuid>
# Create an agent
cargo-ai ai agent create \
--name "Lead Researcher" \
--icon-color blue --icon-face 🤖 \
--description "Researches leads and enriches data"
# Update an agent
cargo-ai ai agent update --uuid <agent-uuid> \
--name "Senior Lead Researcher" \
--description "Updated description"
# Move to a folder (find folder UUIDs via cargo-workspace-management)
cargo-ai ai agent update --uuid <agent-uuid> --folder-uuid <folder-uuid>
# Remove an agent
cargo-ai ai agent remove <agent-uuid>
Agent 图标: --icon-color 必须是以下值之一:grey、green、purple、yellow、blue、red。--icon-face 是一个表情符号字符串。
文件夹: 文件夹的创建、列出和管理位于 cargo-workspace-management(cargo-ai workspaceManagement folder list/create/...)。使用该技能查找或创建要在此处传给 --folder-uuid 的 <folder-uuid>。
发布版本
发布版本是 Agent 配置(系统提示词、操作、资源、模型、温度)的版本化快照。Agent 基于其已部署的发布版本执行。
# List releases for an agent
cargo-ai ai release list --agent-uuid <uuid>
# Get a specific release
cargo-ai ai release get <release-uuid>
# Get the current draft release (editable)
cargo-ai ai release get-draft --agent-uuid <uuid>
# Update the draft release
cargo-ai ai release update-draft --agent-uuid <uuid> \
--system-prompt "You are a lead research assistant..." \
--language-model-slug gpt-4o \
--temperature 0.3 \
--max-steps 10
# Deploy the draft release (makes it live)
cargo-ai ai release deploy-draft --agent-uuid <uuid> \
--integration-slug openAi \
--language-model-slug gpt-4o \
--actions '[]' \
--mcp-clients '[]' \
--resources '[]' \
--capabilities '[]' \
--suggested-actions '[]' \
--description "Added research actions"
对于支持推理的模型,update-draft / deploy-draft 上的 --with-reasoning [true|false] 可开启推理模式(单独使用该标志时默认为 true)。
编码 Agent(--harness-slug、--repository)
带有 harness 的发布会以编码 Agent 的形式运行:每一轮都会在包含 Git 检出的沙箱中工作,而不是进行普通的聊天循环。Harness 标识:claudeCode、codex、openCode、deepAgents。
cargo-ai ai release deploy-draft --agent-uuid <uuid> \
--harness-slug claudeCode --integration-slug anthropic --language-model-slug <model-slug> \
--repository '{"connectorUuid":"<github-connector-uuid>","repository":"acme/app","defaultBranch":"main","rootDirectory":null}' \
--actions '[]' --mcp-clients '[]' --resources '[]' --capabilities '[]' --suggested-actions '[]'
--repository(JSON):connectorUuid(一个 GitHub 连接器,用于识别用户,并非 Agent 扮演的身份)、repository(格式为owner/name)、defaultBranch、rootDirectory、env([{key, type:"public", value}]或{key, type:"secret", secretValue}),以及runAsUserUuid——一个服务用户,沙箱会获取其临时CARGO_API_TOKEN(帮助信息中未提及;请参阅../cargo-workspace-management/SKILL.md→“服务用户”;你的权限必须涵盖该用户,否则调用会返回 403runAsUserNotFound/runAsUserNotPermitted)。- Agent 扮演 Cargo GitHub 应用的身份,绝不扮演已连接用户的身份:它会以该应用安装实例的身份克隆、推送、评论和创建 PR。请先在仓库上安装该应用——否则该轮会失败。沙箱的 GitHub 令牌仅限于该仓库,访问其他任何仓库都会被拒绝;令牌有效期为 1 小时,每轮都会刷新;它会从聊天输出中脱敏,但 Agent 可以读取。
- 它会在
cargo/<short-name>分支上工作,绝不推送到默认分支,也绝不强制推送;并通过自己的 PR 工具创建或更新 PR,该工具会将 PR 与聊天关联起来。 - 如果有人在该 Agent 聊天创建的 PR 上提及应用,就会继续同一聊天——无需触发器(如果聊天已转移到其他仓库,或 PR 由另一个 Agent 创建,则会跳过)。关闭聊天即可停止。GitHub 触发器会添加
allPullRequests(回复仓库中任何 PR 上的提及)、fixFailedChecks(以及maxCheckFixAttempts,范围为 1–10;有人提及或审查时会重置)和addressReviews,这些选项的默认值均为false。
按聊天设置,而非按发布设置。 ai chat create --harness-slug … --repository … 和 ai message create(针对其自动创建的聊天)接受相同的两个标志;如果省略,则由 Agent 固定使用的发布版本决定。它们在创建聊天时设置:与 --chat-uuid 一起传入任一标志会返回 400——harnessSlug and repository are not allowed with chatUuid: they are set when the chat is created. Create a new chat to use another harness or repository.
如果向仍在回复的聊天发送消息,该消息会被排队:返回 202,包含 userMessage,此时尚无助手消息;前一轮结束后才会收到回复(chatClosed → 409,chatNotFound → 404)。发送和轮询方式:../cargo-orchestration/SKILL.md。在项目中使用:defineAgent({ harness, repository }) — ../cargo-project/references/resources.md。
结构化输出和心跳 — 尚未公开为 CLI 标志
发布 API 载荷(draft/update 和 draft/deploy)接受两个字段,但 release update-draft / release deploy-draft 并未将它们公开为标志(已对照 CLI 源码确认——没有 --output / --output-schema 或 --heartbeat):
| 字段 | 形式 | 用途 |
|---|---|---|
output | {"type":"text"} 或 {"type":"jsonSchema","jsonSchema": <standard JSON Schema object>} | 强制 Agent 返回符合 JSON Schema 的结构化输出。 |
heartbeat | {"intervalMinutes": number, "maxMessages": number, "prompt": string | null} | 定期重新唤醒聊天(intervalMinutes),直到达到 maxMessages;prompt 是唤醒消息(null = 通用的“继续”)。 |
通用的 --options 标志不包含这些字段——API 的 options 仅包含 {connectorUuidsByIntegrationSlug, modelUuidsByIntegrationSlug}。在这些标志发布之前,请使用与 CLI 相同的端点直接调用 API 来设置它们:
# Structured (JSON Schema) output on the draft release
curl -sS -X PUT "$CARGO_BASE_URL/v1/ai/releases/draft/update" \
-H "Authorization: Bearer $CARGO_API_TOKEN" -H "Content-Type: application/json" \
-d '{"agentUuid":"<uuid>","output":{"type":"jsonSchema","jsonSchema":{"type":"object","properties":{"score":{"type":"number"}},"required":["score"]}}}'
# Deploy carries the same fields — POST .../v1/ai/releases/draft/deploy
draft/update 是部分更新:省略的字段会保留其当前草稿值。draft/deploy 的请求体必须包含 actions、mcpClients、resources、capabilities 和 suggestedActions。提交一份 workspaceManagement report(参见 ../cargo-workspace-management/SKILL.md),申请提供正式的 --output / --heartbeat 标志——这是针对 CLI/UI 功能不一致问题的指定反馈渠道。
Agent 配置工作流:
- 浏览模板以获取灵感:
cargo-ai ai template list— 它会完整返回每个模板(系统提示词、模型、温度、工具),因此可直接从返回结果中选择最符合你用例的模板 - 创建 Agent:
cargo-ai ai agent create --name "..." --icon-color blue --icon-face 🤖 - 获取发布草稿:
cargo-ai ai release get-draft --agent-uuid <uuid> - 使用配置好的工具、资源、提示词和模型更新草稿:
cargo-ai ai release update-draft --agent-uuid <uuid> ... - 部署:
cargo-ai ai release deploy-draft --agent-uuid <uuid> ...
模板
模板是预先构建的 Agent 配置,其中包含适用于常见用例的成熟模式。从头开始设计 Agent 之前,务必先查看模板——模板提供了可直接采用或调整的现成系统提示词、推荐语言模型、温度和工具配置。
# List available agent templates — each entry is complete, so this is the only
# call you need. There is no `template get` subcommand.
cargo-ai ai template list
# Inspect one by slug: filter the same response
cargo-ai ai template list | jq '.templates[] | select(.slug == "<slug>")'
模板包含系统提示词、工具、资源和推荐的模型设置。可将其作为起点,并通过 release update-draft 自定义。完整指南(包括根据模板创建 Agent 的端到端示例)请参阅 references/examples/templates.md。
模型与温度建议
| 用例 | 推荐模型 | 温度 |
|---|---|---|
| 分类、提取、评分 | gpt-6-luna 或 gpt-4o-mini | 0.0 – 0.2 |
| 研究、摘要、分析 | gpt-6-sol 或 claude-sonnet-5 | 0.2 – 0.5 |
| 文案撰写、个性化 | claude-sonnet-5 或 gpt-6-sol | 0.5 – 0.8 |
| 头脑风暴、最复杂的推理 | claude-opus-5-5 或 gpt-6-astra(高端场景可用 claude-fable-5-1) | 0.7 – 1.0 |
模型标识必须在连接器的实时列表中;否则,release update-draft 和 deploy-draft 会失败并报错 languageModelNotFound(每当发布版本配置了连接器时都会检查——草稿默认使用 OpenAI 连接器,因此 Anthropic 模型标识还需同时指定 --integration-slug anthropic --connector-uuid <uuid>)。免费列出连接器提供的模型、每 1,000 个令牌的积分数以及 isReasoning:
cargo-ai connection connector get-language-models <connector-uuid>
价格跨度达三个数量级(gpt-6-luna 为每 1k 个令牌 0.003,claude-sonnet-5 为 0.2,claude-opus-5-5 为 1.6,claude-fable-5-1 为 4),因此为高用量 Agent 选择模型前请先查看价格。Cargo 的 Anthropic 模型列表已将 claude-3-5-sonnet-latest 标记为已弃用——请将 Agent 迁离该模型。
低温度(0.0–0.2)=输出确定且一致。高温度(0.7 以上)=输出更有创意、变化更多。对于处理数千条记录的生产工作流,建议使用低温度。
RAG 知识(文件与库)
为 Agent 响应提供依据的知识(检索增强生成,RAG)来自 content 域——参见 cargo-content:
- 文件——上传的二进制文件(PDF、CSV、文本)。
- 库——用于归集文件的集合,可以是
native(由工作区管理),也可以由connector提供支持(通过非结构化数据提取器从外部来源同步)。
在 CLI ≥ 1.0.19 中,文件和库已从
ai移至顶层content域(cargo-ai content file …/cargo-ai content library …)。旧的ai file …命令已移除。所有与内容相关的功能现在都位于cargo-content。
将知识附加到 Agent
文件或库只有通过草稿发布版本的 resources 数组附加到 Agent 并完成部署后才能使用。在 cargo-content 中上传文件或创建库,然后在此处通过 release update-draft --resources … 配置,再执行 release deploy-draft。完整的上传 → 附加 → 部署流程参见 ../cargo-content/references/examples/files.md。
只有已建立索引的文件才能搜索。 以 indexMode: "none" 存储的文件(content file put、workers、writeFile 节点和 Agent 写入的默认值)可以列出和读取,但无法搜索:capability_file_list 会将其标记为 isSearchable: false,capability_file_search 会跳过该文件,而 capability_file_analyze 会拒绝处理。请附加通过 upload 上传的文件(默认会建立索引)用于 RAG,或使用 --index vectorStore 重新写入文件。
让 Agent 写入文件
"isReadOnly": false 的文件资源还会授予其列出的文件夹 capability_file_write 权限({"kind":"folder","folderUuid":"…"} 项;列出的文件仍为只读)。未设置时为只读。
cargo-ai ai release update-draft --agent-uuid <agent-uuid> \
--resources '[{"kind":"file","slug":"outputs","name":"Outputs","description":null,"prompt":"Save each report here.","isReadOnly":false,"items":[{"kind":"folder","folderUuid":"<folder-uuid>"}]}]'
- Agent 会将生成的文本(≤ 1,000,000 个字符)写入其中一个文件夹内的相对路径(会创建子文件夹),不能写入工作区的其他位置。如果有多个可写文件夹,必须指定其中一个。
- 每次 Agent 写入的文件都会存为
private,并设置indexMode: none和mirrorToContext: false,即使它覆盖了他人创建的公开文件也是如此。写入会返回{ fileUuid, path, size, url },其中url是有效期为 1 小时的签名链接,任何持有该链接的人都可以打开。 - 写入会原地覆盖该文件夹中同名的最新文件。请为 Agent 指定专用输出文件夹,不要使用存放其所读知识的文件夹。
- 在项目中:
defineAgent({ files: [{ items: [folder], readOnly: false }] })— 参见../cargo-project/references/resources.md。
MCP — 两个方向,别混淆
在 Cargo 中,MCP(Model Context Protocol)可以双向运行,这两个界面互不相关:
发布 — ai mcp-server | 使用 — ai mcp-client | |
|---|---|---|
| 含义 | 由你的工作区公开的服务:你选择开放调用的工具、Agent 和数据 | 连接到他人的 MCP 服务 |
| 调用方 | 任意 MCP 客户端 — Claude Code、Claude Desktop、Cursor、ChatGPT | 你的 Cargo Agent,在聊天或工作流运行期间调用 |
| 配置方式 | cargo-ai mcp --server <uuid>(下文介绍的 stdio 桥接) | release update-draft --mcp-clients … |
开始构建前,先检查平台 MCP 是否已涵盖相关需求。 Cargo 现在提供一方 MCP 服务,地址为 https://mcp.getcargo.io/mcp — 面向每个工作区成员,无需部署 — 提供一组用于操作工作区的小型固定工具集(whoami、get_usage、search_actions、get_action_schema、autocomplete_action、execute_action、execute_action_batch、get_run、get_batch、list_runs、list_models、describe_model、query_models,以及只读上下文工具 map_context、search_context、browse_context、read_context)。托管客户端(ChatGPT connectors、Claude.ai、通过 HTTP 连接的 Cursor)指向此 URL,并通过 OAuth 登录;如果用户属于多个工作区,授权页面会让用户选择工作区。ai mcp-server 用于另一类需求:为客户端提供经过筛选且命名明确的工具子集 — 这个工具、那个 Agent、这个经过筛选的模型 — 让客户端只能看到这些内容。
发布工作区 MCP 服务
cargo-ai ai mcp-server list
cargo-ai ai mcp-server create --name "CRM tools" \
--actions '[{"slug":"<action-slug>","kind":"tool","toolUuid":"<tool-uuid>","templateSlug":null,"waitUntilFinished":true,"name":null,"description":null,"isBulkAllowed":false,"config":{}}]' \
--resources '[{"kind":"model","slug":"<slug>","name":"Accounts","description":null,"integrationSlug":"hubspot","modelUuid":null,"filter":null,"selectedColumnSlugs":null,"limit":null,"prompt":null,"isReadOnly":true}]'
cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Updated name"
cargo-ai ai mcp-server remove <mcp-server-uuid>
- Actions 接受
kind: "tool"或kind: "agent"— Agent 也可以作为可调用的 MCP 工具公开,不只是工具。waitUntilFinished用于控制调用是否会等待运行完成。 - 资源接受
kind: "model"(经过筛选并选择列的模型视图 — 除非客户端需要写入,否则应保持isReadOnly: true)或kind: "file"(按 UUID 指定工作区文件,参见../cargo-content/SKILL.md)。 - Capabilities(CLI ≥ 1.0.86)用于在服务上公开 Cargo 内置工具,以及你的 Actions 和资源。JSON 数组,格式为
{slug, config}:
十一个 slug 分别是cargo-ai ai mcp-server create --name "Research" \ --capabilities '[{"slug":"webSearch","config":{}}]'sandbox、memory、context、app、document、webSearch、action、model、file、documentationSearch和suggestedActions— 与 Agent 发布时通过自身--capabilities接受的集合相同,因此上面的示例会传入'[]',而不是省略该参数。在项目中,同一字段也接受不带配置的 slug(capabilities: ["webSearch"])。 update会整体替换--actions/--resources/--capabilities,而非合并 — 请通过mcp-server get <uuid>读取当前服务配置,并传回完整数组。
将其提供给编码 Agent — cargo-ai mcp
任一服务都可通过 CLI 连接到任何 stdio MCP 客户端,并使用机器上已有的凭据。无需将令牌复制到客户端配置中。
claude mcp add cargo -- cargo-ai mcp # the platform MCP (no setup)
cargo-ai ai mcp-server list # find a curated server's UUID
claude mcp add cargo -- cargo-ai mcp --server <uuid> # that curated server instead
# Cursor, Windsurf, and other stdio clients: same command as the server entry
如果未指定 --server,桥接程序会在设置了 CARGO_MCP_SERVER_UUID 时使用它,否则使用平台的 /mcp。**此行为已更改:**旧版 CLI 会解析“工作区唯一的 MCP 服务”,若工作区中没有或有多个 MCP 服务,则会因 InvalidUsage 而失败;现在,直接运行 cargo-ai mcp 总能提供服务。stdout 承载 MCP 协议,所有日志都写入 stderr,因此切勿在其周围向 stdout 输出任何内容。
**何时选择此方式,而不是使用技能:**技能会向 Agent 提供完整 CLI;MCP 接口则提供范围有限、无需 shell 的一组功能。使用桥接程序进行对话中的查询和一次性操作;使用 CLI 处理批量任务、工作流、架构变更以及任何设有成本门槛的操作。完整的路由规则:../cargo/SKILL.md →“这些技能与 Cargo 的 MCP 接口”。
使用外部 MCP 服务
cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse
cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse \
--disabled-tool-slugs "dangerous_tool,other_tool"
--authentication 接受 {"issuedAt": "...", "accessToken": "..."} 或 "null"。已连接的客户端通过 Agent 的发布版本附加到 Agent:先执行 release update-draft --mcp-clients …,然后执行 release deploy-draft。
记忆
记忆是 Agent 从对话中保存、供将来参考的信息。记忆的作用范围为某个用户或特定 Agent(--scope user|agent;不支持工作区范围)。
# List agent memories
cargo-ai ai memory list --scope agent --agent-uuid <uuid>
# List user-scoped memories
cargo-ai ai memory list --scope user
# Update a memory
cargo-ai ai memory update \
--mem0-id <id> \
--scope agent --agent-uuid <uuid> \
--content "Updated memory content"
# Remove a memory
cargo-ai ai memory remove \
--mem0-id <id> \
--scope agent --agent-uuid <uuid>
聊天、文档、投票和提示词辅助工具
发送消息和轮询消息是 cargo-orchestration 的工作;以下是聊天相关的维护命令,以及两个提示词编写辅助工具。
# Chats — list (filter by agent, release, user, or how the chat started), read, rename, delete
cargo-ai ai chat list --agent-uuid <uuid> --trigger-type schedule --limit 20
# --trigger-type: chat | connector | draft | web_extension | app | schedule | workflow
cargo-ai ai chat get <chat-uuid>
cargo-ai ai chat update --uuid <chat-uuid> --name "Q4 pipeline review"
cargo-ai ai chat remove <chat-uuid>
# Feedback on one assistant message, and the votes on a chat
cargo-ai ai vote upsert --chat-uuid <chat-uuid> --message-uuid <message-uuid> --is-upvoted false
cargo-ai ai vote list --chat-uuid <chat-uuid>
# Documents — the versioned text / code / image / sheet artifacts an agent writes in a chat
cargo-ai ai document get <document-uuid> # latest version
cargo-ai ai document list --uuid <document-uuid> --limit 10 # its versions
cargo-ai ai document create --uuid <document-uuid> --kind text --title "Brief" --content "…" # new version
cargo-ai ai document reset --uuid <document-uuid> --created-at <version-createdAt> # drop every later version
# Suggested follow-ups for a message (cache with --cache-key to avoid regenerating)
cargo-ai ai suggested-action generate --message-uuid <message-uuid> --agent-uuid <agent-uuid>
# Prompt helpers
cargo-ai ai prompt optimize --prompt "find companies in SF and enrich them"
cargo-ai ai prompt evaluate --prompt "<system prompt with {{…}} expressions>" --actions '[...]' --resources '[...]'
prompt optimize使用固定的小型模型,以温度 0 将粗略指令改写为结构化系统提示词(角色、行为、避免事项)。请将结果视为待编辑的草稿,而非可直接发布的提示词。prompt evaluate不会对任何内容评分(CLI 1.0.128 之前的帮助信息曾声称会评分)。它会呈现提示词:根据你传入的--actions、--resources和--capabilities解析其中的模板表达式,并返回 Agent 实际会收到的提示词文本。部署发布版本之前,可用它检查系统提示词中的{{…}}引用是否已解析。document reset具有破坏性——你指定版本之后创建的所有版本都会被删除。先运行list --uuid,选择createdAt。- 点踩是工作区保存的反馈;它不会改变 Agent。修复答案需要更改发布版本(提示词、模型、资源)。
帮助
每个命令都支持 --help:
cargo-ai ai agent create --help
cargo-ai ai release update-draft --help
cargo-ai ai mcp-server create --help
cargo-ai ai memory list --help