cargo-content
Manage the knowledge a Cargo workspace holds — upload files (PDF, CSV, text), rename and organize them, and build native or connector-backed libraries that sync from an external source, so agents can retrieve them (RAG). Triggers: "upload this PDF", "add these docs as knowledge", "build a knowledge
By getcargohq · 6,618 installs
npx skills add getcargohq/cargo-skills --skill cargo-content
Source repository · Upstream listing
Cargo CLI — Content
Workspace files : upload and organize them (PDFs, CSVs, text) and group or sync them into libraries — the knowledge resources that ground agent responses (retrieval augmented generation, RAG). Files are also plain storage : write one at a path, read it back, list a folder, and hand out a link, from the CLI, the HTTP objects API, a hosted worker, a workflow node, or an agent — see [Files as storage]( files as storage paths and links).
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 ](../cargo ai/SKILL.md).
For folders that organize files, use [ cargo workspace management ](../cargo workspace management/SKILL.md) ( 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 ](../cargo workspace management/SKILL.md).
See references/examples/files.md for end to end file, library, and attach to agent examples.
See references/objects.md for files as storage: the path model, storage settings and their per surface defaults, signed and public links, the context mirror, and the HTTP / worker / node / agent surfaces.
See references/response shapes.md for full JSON response structures.
See references/troubleshooting.md for common errors and how to fix them.
Bootstrap
Already signed in ( cargo ai whoami returns a workspace)? Skip to the next section.
Every command prints JSON to stdout; failures exit non zero with {"errorMessage": "..."} . Anything that creates a run or a batch is async — pass wait until finished or poll the matching get . When the full skill bundle is installed, [ ../cargo/references/prerequisites.md ](../cargo/references/prerequisites.md) adds the CLI version pin, token scopes, and the admin only surface.
Discover resources first
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 ](../cargo ai/SKILL.md)).
Content files in the context repo. A file with mirrorToContext: true — the default for upload , web app uploads and defineFile — is committed and pushed into the context repository under .files/<path (commit content(mirror): upsert <name ; over 10 MB, a JSON metadata sidecar instead of the bytes), so a command in the context runtime sandbox can read it — e.g. cargo ai context runtime execute command ls args '[" 1",".files"]' — and anyone with access to that repo can too. Path writes ( put , the objects API, workers, nodes, agents) default to mirrorToContext: false and stay out of git. .files/ is read only from the context runtime ( deniedPath ); change those files with content file here. See [ cargo context ](../cargo context/SKILL.md).
Files as storage (paths and links)
A file's path is its folder chain plus its name ( reports/2026 q3/summary.pdf ). Writing to a path creates missing folders and overwrites the newest file of that name in place (same uuid , settings kept unless you pass new ones).
Option upload / web app / defineFile put / objects API / worker / writeFile node Agent write
indexMode ( index ) vectorStore none always none
mirrorToContext true false always false
visibility private private always private
The same files over HTTP are objects — PUT / GET ( ?meta=true for details) / DELETE /v1/content/objects/<path , GET /v1/content/objects?prefix= — and from a worker createCargoObjects(env) ( @cargo ai/worker sdk ); in a play, the writeFile / readFile / getFileUrl nodes; on an agent, a writable folder ( capability file write ). All of it in [ references/objects.md ](references/objects.md).
Libraries
A library groups files. Agent release resources take file or folder items, not a library UUID, so an agent reaches a library through its files or the folder they land in. There are two kinds:
native — workspace managed collections of uploaded files (not creatable from the CLI: library create is connector only).
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 ](../cargo connection/SKILL.md).
Critical rules
A signed URL is unauthenticated. Anyone holding it opens the file until it expires (default 3600 s, max 10800 s). A public file adds a stable no auth link, https://api.getcargo.io/files/public/<uuid /<name , that works until the file is made private or deleted. Hand out either only when the user asked for the file to be shared, and never for record level personal data.
upload and put default differently. upload indexes ( vectorStore , sent to OpenAI) and mirrors into the context repo; put does neither. A put file is not searchable by an agent — capability file search skips it and capability file analyze refuses it — until written with index vectorStore .
A mirrored file is in git. mirrorToContext: true commits the file to the context repository under .files/ ; pass index none and keep mirroring off ( put ) for files that should stay in Content.
A path write overwrites without asking. The newest file of that name in that folder is replaced in place, and its uuid (and every agent resource pointing at it) now serves the new bytes. A read only (connector) folder refuses with folderReadOnly .
Attaching to an 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 ](../cargo ai/SKILL.md) ( ai release update draft resources … → ai release deploy draft ). See references/examples/files.md for the upload → attach → deploy sequence.
Help
Every command supports help :