cargo-context
Original:🇺🇸 English
Translated
Inspect and edit the workspace's git-backed context repository (the GTM knowledge base of markdown/MDX files) and its runtime sandbox using the Cargo CLI. Use when the user wants to browse/read/write/edit context files, run a command in the sandbox, or inspect the context knowledge graph.
8installs
Sourcegetcargohq/cargo-skills
Added on
NPX Install
npx skill4agent add getcargohq/cargo-skills cargo-contextTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Cargo CLI — Context
The context is a git-backed repository of typed markdown/MDX files that captures a workspace's GTM knowledge (company narrative, ICPs, personas, plays, proof, objections, etc.) and is read/written by both humans and agents. The domain has two subdomains you'll use:
cargo-ai context- runtime — browse, read, write, edit, and execute against the workspace's runtime sandbox (a checked-out copy of the context repo). /
writeare pushed to the default branch;editruns are not pushed.execute - graph — build/load the knowledge graph derived from every markdown/MDX file in the context repo.
The canonical example of a context repository is. Read itsgetcargohq/cargo-workspacesto understand the domain layout and file conventions before writing new entries. For uploading runtime-independent files (CSVs, PDFs) used in batch runs, useREADME.md(cargo-workspace-management) instead. For RAG file attachments to agents, usecargo-ai workspaceManagement file upload(cargo-ai).cargo-ai content file upload
Seefor the full context repo structure and per-domain templates. Seereferences/conventions.mdfor the JSON shapes returned by eachreferences/response-shapes.mdcommand. Seecargo-ai contextfor common errors and how to fix them. Seereferences/troubleshooting.mdfor end-to-end add / edit / delete recipes. Seereferences/examples/authoring.mdfor the bootstrap + refresh-from-calls playbook. Seereferences/examples/lifecycle.mdfor inspecting the knowledge graph.references/examples/graph-queries.md
Prerequisites
See for install, login ( / ), JSON output conventions, and error shapes. Verify the session with before running any of the commands below — and push commits to the workspace's context repo, so confirming first is non-negotiable.
../cargo/references/prerequisites.md--oauth--tokencargo-ai whoamiruntime writeruntime editworkspace.nameDiscover the context first
Before editing anything, see what's in the context repo:
bash
cargo-ai context runtime browse # list entries at the runtime sandbox root
cargo-ai context graph get # full knowledge graph derived from the repo's md/mdx filesQuick reference
bash
# Runtime sandbox (checked-out copy of the context repo)
cargo-ai context runtime browse [--path <path>]
cargo-ai context runtime read --path <path> [--start-line <n>] [--end-line <n>]
cargo-ai context runtime write --path <path> --content <content> [--commit-message <message>]
cargo-ai context runtime edit --path <path> --old-string <old> --new-string <new> [--commit-message <message>]
cargo-ai context runtime execute --command <command> [--args <json>]
# Knowledge graph
cargo-ai context graph getRuntime sandbox
The runtime sandbox is a checked-out, executable copy of the context repository. It's the surface you use to read and modify context files, and to run commands against them.
Two important behaviors to remember:
- and
writepush to the default branch of the context repo. They are not local-only.edit - does not push. Changes made to files by a shell command run via
executestay in the sandbox and are discarded — useexecutefor builds, tests, or inspection, not for committing edits.execute
Uploaded content files are available read-only under . The workspace's uploads (PDFs, CSVs, text — see ) appear in the sandbox under a directory, so a command run via (or /) can consume them — e.g. . It sits outside the committed context tree: the sandbox's auto-commit skips it, so nothing under is ever pushed to the context repo, and you can't add or change content files from here (use instead).
.files/content filecargo-content.files/executereadbrowsecargo-ai context runtime execute --command ls --args '["-1",".files"]'.files/cargo-ai content file …Because writes push immediately, confirm the target workspace before the first /:
writeeditbash
cargo-ai whoami # → workspace.uuid, workspace.nameRead the workspace name back to the user. If the session is for a specific client, make sure matches before authoring anything — there is no dry-run mode. If is generic or ambiguous (e.g. "Main", "Test", a person's name, an internal codename), don't guess — ask the user for the company name and canonical domain () and confirm both before the first write. If you logged in without pinning a workspace, re-run (or for non-interactive use).
workspace.nameworkspace.nameexample.comcargo-ai login --oauth --workspace-uuid <uuid>--token <workspace-scoped-token>Edits derived from sales-call analysis should be applied one at a time with human review, not batched. Looping an agent over many calls tends to overweight the loudest signal and miss nuance — see for the call-refresh playbook.
references/examples/lifecycle.mdBrowse and read
bash
# List entries at the root of the runtime sandbox
cargo-ai context runtime browse
# List entries under a subpath (e.g. a domain folder like persona/ or play/)
cargo-ai context runtime browse --path persona
# Read a full file
cargo-ai context runtime read --path persona/vp-sales-mid-market.md
# Read only a line range (1-indexed, inclusive on both ends)
cargo-ai context runtime read --path play/inbound-trial-to-paid.md --start-line 1 --end-line 40Write a new file
writeBegin every / file with a YAML frontmatter block setting and . Frontmatter is not validated — a file with missing, empty, or malformed frontmatter is still written and committed; it just indexes poorly in the graph (a missing falls back to the filename, the node summary to the first paragraph). can still fail for other reasons — , , , , or (e.g. writing under ); see .
.md.mdxtitledescriptiontitlewriterepositoryNotFoundsyncConflictsyncFailedfailedToWritedeniedPath.files/references/response-shapes.mdbash
cargo-ai context runtime write \
--path persona/vp-sales-mid-market.md \
--content "$(cat <<'EOF'
---
title: VP of Sales, mid-market
description: Owns pipeline, quota, and rep productivity at a 200–2,000-person company.
---
## Role
- Title: VP of Sales
- Seniority: Executive
- Function: Revenue
- Reports to: CRO or CEO
## KPIs
- New ARR, win rate, pipeline coverage, rep ramp time
## Pains
- Pipeline gaps, slow ramp, low rep activity, forecasting drift
## Motivations
- Hit the number, build a repeatable motion, get visibility
## Day-to-day
Forecast calls, deal reviews, pipeline reviews, 1:1s with frontline managers.
## Preferred channels
- medium/linkedin-outbound
- medium/exec-warm-intro
## Common objections
- objection/we-already-have-an-ai-sdr
## How we land
Lead with pipeline-coverage math, not features.
EOF
)" \
--commit-message "Add VP of Sales mid-market persona"Edit an existing file
edit--old-string--new-stringedittitledescriptioneditstringNotFoundstringNotUnique--old-stringfileNotFoundnoOpsyncConflictsyncFailedfailedToEditdeniedPathbash
# Replace one specific sentence
cargo-ai context runtime edit \
--path global/positioning.md \
--old-string "We help RevOps automate workflows." \
--new-string "We help RevOps run AI-native GTM motions." \
--commit-message "Refresh positioning one-liner"
# Delete a line (pass empty --new-string)
cargo-ai context runtime edit \
--path persona/vp-sales-mid-market.md \
--old-string "\n- Outdated stat: 4.2x pipeline\n" \
--new-string ""For larger restructures, prefer (full-file overwrite) over many sequential calls.
writeeditExecute a command in the sandbox
executebash
# Find every file that cross-references a specific slug
cargo-ai context runtime execute \
--command grep \
--args '["-r","-l","persona/vp-sales-mid-market","."]'
# Count entries per domain
cargo-ai context runtime execute --command ls --args '["-1","persona"]'
# Run a one-shot script (no quotes/escaping needed inside --command beyond JSON for args)
cargo-ai context runtime execute --command pwd--argsContext repository structure and conventions
The Cargo context repo is a typed knowledge base. The canonical example — and the source of the conventions below — is ; read its and files in each domain before writing new entries. For the full domain reference, see .
getcargohq/cargo-workspacesREADME.md_template.mdreferences/conventions.mdDomains
| Domain | Purpose |
|---|---|
| Company-level context: mission, voice, positioning, narrative, pricing |
| Ideal Customer Profile segments |
| Buyer personas (roles inside an ICP) |
| Jobs-to-be-done framings |
| Competitors, substitutes, status quo |
| Customer profiles, case studies, reference accounts |
| Market insights and observations |
| Channel playbooks (email, LinkedIn, cold call, etc.) |
| Objections + responses + proof |
| GTM plays (signal → audience → channel → sequence → outcome) |
| Atomic proof points (metrics, quotes, case data) |
| Buying signals and intent triggers |
File conventions
- Filename: (e.g.
kebab-case.md).vp-sales-mid-market.md - Frontmatter: start every /
.mdfile with YAML frontmatter setting.mdxandtitle. This is a strong convention, not enforced — a write with missing, empty, or malformed frontmatter is still created and committed; it just indexes poorly. The graph readsdescription(fallback: filename) andtitle(fallback: the file's first paragraph); it does not readsummary, so add adescriptionif you want to control the node summary. See Source references and graph edges.summary: - Cross-references: use the form, no
domain/slugextension (e.g..md). To register as a graph edge a reference must use one of the three link forms below — a barepersona/vp-sales-mid-market(or file path) in plain prose creates no edge.domain/slug - Templates: each domain ships an . Read it (
_template.md) before authoring a new entry.cargo-ai context runtime read --path persona/_template.mdfiles are excluded from the graph — never reference them._template.*
Source references and graph edges
The knowledge graph is built from every , , , and file in the repo (any folder; only is excluded). Each file is a node, but edges are created only from three forms — anything else is invisible to the graph:
.md.mdx.yaml.yml.git/- Frontmatter list (preferred for source citations — keeps prose clean):
references:yaml--- title: AgoraPulse expansion thesis description: Why AgoraPulse is ready for a multi-thread expansion play. references: - outputs/sales-notes/2026-06-05-agorapulse-build-session-1-outcomes.md --- - A Markdown link in the body — standard followed immediately by
[label]syntax, where the target is the file path, e.g. an anchor linking to(path).outputs/sales-notes/2026-06-05-agorapulse-build-session-1-outcomes.md - Wikilinks in the body (extension optional): .
[[outputs/sales-notes/2026-06-05-agorapulse-build-session-1-outcomes]]
Key constraints:
- Never cite a source as a bare path in prose (e.g. a line that just mentions
Source:as text) — it is not parsed and creates no edge.outputs/sales-notes/foo.md - Prefer root-relative paths (resolved from the repo root first, then relative to the citing file) so links work regardless of where the document lives.
- Extensions are optional — the resolver auto-tries ,
.md,.mdx,.yamlin that order. Including the extension is fine..yml - The target must exist or the edge is broken (a dead link in the graph UI). Verify with before citing.
runtime browse - For docs with a Source/Evidence section, cite the files in frontmatter ; use inline markdown links when the citation needs surrounding prose. Full rules:
references:.references/conventions.md
Workflow: add a new entry
- Confirm the target domain and copy its template:
bash
cargo-ai context runtime read --path persona/_template.md - a new file at
writewith<domain>/<slug>.md+titleand the body sections filled in.description - Add cross-refs () where useful — keep them bidirectional when it makes sense.
domain/slug - Rebuild the knowledge graph to verify the new entry and its links:
bash
cargo-ai context graph get
For full per-domain templates and worked examples, see and .
references/conventions.mdreferences/examples/authoring.mdWorkflow: bootstrap and refresh
To stand up a new workspace's context repo from scratch, or to refresh an existing one on a cadence, follow the two-phase lifecycle in :
references/examples/lifecycle.md- Bootstrap (one-time): seed ,
global/,persona/,client/,proof/,objection/from public sources, then open a fresh agent session against the seeded repo. For the prescriptive, automatable version (domain in → files out, idempotent, with credit budget), usesignal/.references/examples/bootstrap-from-domain.md - Refresh (every 2–4 weeks): pull the last ~3 months of sales-call transcripts → analyze one at a time, human-in-the-loop → apply a repetition threshold before promoting any claim to context → validate by generating sequence permutations → diff the graph before/after and retire stale entries.
The repetition threshold (how many calls a claim must appear in before it lands in context) is documented in .
references/conventions.mdKnowledge graph
context graph get- Audit cross-references between domains (e.g. find personas that link to plays with no proof attached).
- Discover what already exists before writing a new entry (avoid duplicates).
- Power downstream agents that need the typed structure of the workspace's context.
bash
cargo-ai context graph getThe response includes the parsed frontmatter and outbound references for each node — pipe it through to slice it. See for ready-to-run queries.
domain/slugjqreferences/examples/graph-queries.mdHelp
Every command supports :
--helpbash
cargo-ai context --help
cargo-ai context runtime browse --help
cargo-ai context runtime read --help
cargo-ai context runtime write --help
cargo-ai context runtime edit --help
cargo-ai context runtime execute --help
cargo-ai context graph get --help