cargo-content

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cargo 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 the
ai
domain into the
content
domain —
cargo-ai content file …
and
cargo-ai content library …
. The old
cargo-ai ai file …
commands no longer exist; an
unknown command
error means you're on the old path.
For attaching a file or library to an agent (via the release
resources
array), use
cargo-ai
. For folders that organize files, use
cargo-workspace-management
(
cargo-ai workspaceManagement folder …
). For batch-run input files (CSVs uploaded to drive a batch), that's a different surface —
cargo-ai workspaceManagement file upload
— documented in
cargo-workspace-management
.
See
references/examples/files.md
for end-to-end file, library, and attach-to-agent examples. See
references/response-shapes.md
for full JSON response structures. See
references/troubleshooting.md
for common errors and how to fix them.
工作区知识管理:上传并组织文件(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
cargo-ai workspaceManagement folder …
)。 如需批量运行的输入文件(上传用于驱动批量任务的CSV),属于不同功能模块——
cargo-ai workspaceManagement file upload
——相关文档请查看
cargo-workspace-management
端到端的文件、库及附加到Agent的示例请查看
references/examples/files.md
。 完整的JSON响应结构请查看
references/response-shapes.md
。 常见错误及修复方法请查看
references/troubleshooting.md

Prerequisites

前提条件

See
../cargo/references/prerequisites.md
for install, login (
--oauth
/
--token
), JSON output conventions, and error shapes. Verify the session with
cargo-ai whoami
before running any of the commands below.
安装、登录(
--oauth
/
--token
)、JSON输出约定及错误格式请查看
../cargo/references/prerequisites.md
。在运行以下任何命令之前,请使用
cargo-ai whoami
验证会话有效性。

Discover 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
uuid
you reference when attaching the file to an agent release (see
cargo-ai
).
bash
undefined
上传文件(PDF、CSV、文本),以便Agent可以基于特定知识生成响应。上传响应包含
uuid
,你在将文件附加到Agent发布版本时需要引用该值(请查看
cargo-ai
)。
bash
undefined

List 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:
  • native
    — workspace-managed collections of uploaded files.
  • connector
    — synced from an external source (e.g. a help center or knowledge base) through an unstructured-data extractor (
    --extractor-slug
    ). Get the
    connectorUuid
    from
    cargo-connection
    .
bash
undefined
库将文件分组为一个Agent可引用的资源。分为两种类型:
  • native
    —— 工作区管理的已上传文件集合。
  • connector
    —— 通过非结构化数据提取器(
    --extractor-slug
    )从外部源(如帮助中心或知识库)同步而来。请从
    cargo-connection
    获取
    connectorUuid
bash
undefined

List 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 '{}'
cargo-ai content library create
--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>
undefined
cargo-ai content library update --uuid <library-uuid> --name "Updated Name" cargo-ai content library remove <library-uuid>
undefined

Attaching to an agent

附加到Agent

Files and libraries are knowledge resources — they do nothing until attached to an agent via that agent's draft release
resources
array, then deployed. That wiring lives in
cargo-ai
(
ai release update-draft --resources …
ai release deploy-draft
). See
references/examples/files.md
for the upload → attach → deploy sequence.
文件和库是知识资源——只有通过Agent的草稿发布版本
resources
数组附加并部署后才会生效。相关配置请查看
cargo-ai
ai release update-draft --resources …
ai release deploy-draft
)。上传→附加→部署的完整流程示例请查看
references/examples/files.md

Help

帮助

Every command supports
--help
:
bash
cargo-ai content file upload --help
cargo-ai content library create --help
每个命令都支持
--help
参数:
bash
cargo-ai content file upload --help
cargo-ai content library create --help