cargo-content
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCargo CLI — Content
Cargo CLI — 内容
Workspace knowledge management: upload and organize files (PDFs, CSVs, text) and group or sync them into libraries. These are the binary/grouped knowledge resources that ground agent responses (retrieval-augmented generation, RAG).
New top-level domain (CLI ≥ 1.0.19). Files and libraries moved out of thedomain into theaidomain —contentandcargo-ai content file …. The oldcargo-ai content library …commands no longer exist; ancargo-ai ai file …error means you're on the old path.unknown command
For attaching a file or library to an agent (via the releasearray), useresources. For folders that organize files, usecargo-ai(cargo-workspace-management). For batch-run input files (CSVs uploaded to drive a batch), that's a different surface —cargo-ai workspaceManagement folder …— documented incargo-ai workspaceManagement file upload.cargo-workspace-management
Seefor end-to-end file, library, and attach-to-agent examples. Seereferences/examples/files.mdfor full JSON response structures. Seereferences/response-shapes.mdfor common errors and how to fix them.references/troubleshooting.md
工作区知识管理:上传并组织文件(PDF、CSV、文本),并将它们分组或同步到库中。这些是为Agent响应提供基础的二进制/分组知识资源(检索增强生成,RAG)。
全新顶级域(CLI ≥ 1.0.19)。文件和库已从域迁移至ai域——使用content和cargo-ai content file …命令。旧的cargo-ai content library …命令已不再存在;若出现cargo-ai ai file …错误,说明你使用的是旧路径。unknown command
如需将文件或库附加到Agent(通过发布版本的数组),请使用resources。 如需用于组织文件的文件夹功能,请使用cargo-ai(cargo-workspace-management)。 如需批量运行的输入文件(上传用于驱动批量任务的CSV),属于不同功能模块——cargo-ai workspaceManagement folder …——相关文档请查看cargo-ai workspaceManagement file upload。cargo-workspace-management
端到端的文件、库及附加到Agent的示例请查看。 完整的JSON响应结构请查看references/examples/files.md。 常见错误及修复方法请查看references/response-shapes.md。references/troubleshooting.md
Prerequisites
前提条件
See for install, login ( / ), JSON output conventions, and error shapes. Verify the session with before running any of the commands below.
../cargo/references/prerequisites.md--oauth--tokencargo-ai whoami安装、登录( / )、JSON输出约定及错误格式请查看。在运行以下任何命令之前,请使用验证会话有效性。
--oauth--token../cargo/references/prerequisites.mdcargo-ai whoamiDiscover resources first
先发现资源
bash
cargo-ai content file list # all uploaded files (uuid, name, contentType, size)
cargo-ai content library list # knowledge libraries (native or connector-backed)bash
cargo-ai content file list # 所有已上传文件(uuid、名称、contentType、大小)
cargo-ai content library list # 知识库(原生或连接器支持)Files
文件
Upload files (PDFs, CSVs, text) so an agent can ground its responses in specific knowledge. The upload response includes the you reference when attaching the file to an agent release (see ).
uuidcargo-aibash
undefined上传文件(PDF、CSV、文本),以便Agent可以基于特定知识生成响应。上传响应包含,你在将文件附加到Agent发布版本时需要引用该值(请查看)。
uuidcargo-aibash
undefinedList all files
列出所有文件
cargo-ai content file list
cargo-ai content file list
Get a single file
获取单个文件
cargo-ai content file get <file-uuid>
cargo-ai content file get <file-uuid>
Upload a file (optionally straight into a folder)
上传文件(可直接上传至文件夹)
cargo-ai content file upload --file-path ./knowledge-base.pdf
cargo-ai content file upload --file-path ./knowledge-base.pdf --folder-uuid <folder-uuid>
cargo-ai content file upload --file-path ./knowledge-base.pdf
cargo-ai content file upload --file-path ./knowledge-base.pdf --folder-uuid <folder-uuid>
Update a file's name or folder
更新文件名称或所在文件夹
cargo-ai content file update --uuid <file-uuid> --name "Q1 Research Notes"
cargo-ai content file update --uuid <file-uuid> --folder-uuid <folder-uuid>
cargo-ai content file update --uuid <file-uuid> --name "Q1 Research Notes"
cargo-ai content file update --uuid <file-uuid> --folder-uuid <folder-uuid>
Remove a file
删除文件
cargo-ai content file remove <file-uuid>
> **Reading content files from the context sandbox.** Uploaded content files are also available **read-only** under `.files/` in the context runtime sandbox, so a command run there can consume them — e.g. `cargo-ai context runtime execute --command ls --args '["-1",".files"]'`. The directory sits outside the committed context tree (never pushed, not writable); to add or change files use `content file` here. See [`cargo-context`](../cargo-context/SKILL.md).cargo-ai content file remove <file-uuid>
> **从上下文沙箱读取内容文件**。已上传的内容文件在上下文运行时沙箱中也以**只读**模式存放在`.files/`目录下,因此在沙箱中运行的命令可以访问这些文件——例如`cargo-ai context runtime execute --command ls --args '["-1",".files"]'`。该目录位于已提交的上下文树之外(不会被推送,不可写);若要添加或修改文件,请使用此处的`content file`命令。详情请查看[`cargo-context`](../cargo-context/SKILL.md)。Libraries
库
A library groups files into one resource an agent can reference. There are two kinds:
- — workspace-managed collections of uploaded files.
native - — synced from an external source (e.g. a help center or knowledge base) through an unstructured-data extractor (
connector). Get the--extractor-slugfromconnectorUuid.cargo-connection
bash
undefined库将文件分组为一个Agent可引用的资源。分为两种类型:
- —— 工作区管理的已上传文件集合。
native - —— 通过非结构化数据提取器(
connector)从外部源(如帮助中心或知识库)同步而来。请从--extractor-slug获取cargo-connection。connectorUuid
bash
undefinedList libraries (filter by kind or connector)
列出库(按类型或连接器过滤)
cargo-ai content library list
cargo-ai content library list --kind native
cargo-ai content library list --kind connector --connector-uuid <connector-uuid>
cargo-ai content library list
cargo-ai content library list --kind native
cargo-ai content library list --kind connector --connector-uuid <connector-uuid>
Get a single library
获取单个库
cargo-ai content library get <library-uuid>
cargo-ai content library get <library-uuid>
Create a connector-backed library
创建连接器支持的库
cargo-ai content library create
--name "Help Center"
--connector-uuid <connector-uuid>
--extractor-slug <extractor-slug>
--folder-uuid <folder-uuid>
--config '{}'
--name "Help Center"
--connector-uuid <connector-uuid>
--extractor-slug <extractor-slug>
--folder-uuid <folder-uuid>
--config '{}'
cargo-ai content library create
--name "Help Center"
--connector-uuid <connector-uuid>
--extractor-slug <extractor-slug>
--folder-uuid <folder-uuid>
--config '{}'
--name "Help Center"
--connector-uuid <connector-uuid>
--extractor-slug <extractor-slug>
--folder-uuid <folder-uuid>
--config '{}'
Update / remove
更新 / 删除
cargo-ai content library update --uuid <library-uuid> --name "Updated Name"
cargo-ai content library remove <library-uuid>
undefinedcargo-ai content library update --uuid <library-uuid> --name "Updated Name"
cargo-ai content library remove <library-uuid>
undefinedAttaching to an agent
附加到Agent
Files and libraries are knowledge resources — they do nothing until attached to an agent via that agent's draft release array, then deployed. That wiring lives in ( → ). See for the upload → attach → deploy sequence.
resourcescargo-aiai release update-draft --resources …ai release deploy-draftreferences/examples/files.md文件和库是知识资源——只有通过Agent的草稿发布版本数组附加并部署后才会生效。相关配置请查看( → )。上传→附加→部署的完整流程示例请查看。
resourcescargo-aiai release update-draft --resources …ai release deploy-draftreferences/examples/files.mdHelp
帮助
Every command supports :
--helpbash
cargo-ai content file upload --help
cargo-ai content library create --help每个命令都支持参数:
--helpbash
cargo-ai content file upload --help
cargo-ai content library create --help