Skip to content

Connect a Git repository

Connecting a Git repository makes CAVS the backend for its large files. Your source, history and pull requests stay exactly where they are.

Four things get wired up:

# What Why
1 lfs.url points at …/repositories/{id}/lfs Git LFS talks to CAVS instead of your Git host’s LFS
2 cavs-lfs-agent registered as a standalone transfer agent chunk-level dedup on push and pull
3 A pre-push hook uploads the Git index so the dashboard can show files, commits and branches
4 cavs.repo-id / cavs.api-base in git config so cav knows which repository this working tree belongs to
  1. Have the tools. cav, cavs-lfs-agent and git-lfs:

    Terminal window
    curl -fsSL https://raw.githubusercontent.com/orelvis15/cavs-hub-cli/main/install.sh | sh
    git lfs version # install git-lfs separately if this fails

    The installer places both cav and cavs-lfs-agent in /usr/local/bin (or ~/.local/bin when that isn’t writable).

  2. Sign in, pointing the CLI at production:

    Terminal window
    cav config set api https://cavsnode.com
    cav login
  3. Connect, from inside the Git working tree:

    Terminal window
    cav repo connect acme-ai/vision-models

    Output tells you what it configured, and the initial index backfill runs at the end.

  4. Verify:

    Terminal window
    cav doctor
    git config --get lfs.url
    git config --get lfs.standalonetransferagent # → cavs

Useful flags:

Terminal window
cav repo connect acme-ai/vision-models --skip-lfs # only set lfs.url, don't wire the agent
cav repo connect acme-ai/vision-models --skip-index # no pre-push hook, no initial backfill
cav repo connect acme-ai/vision-models --agent-path /opt/cavs/cavs-lfs-agent

Connecting doesn’t decide which files go to CAVS — Git LFS does, through .gitattributes:

Terminal window
git lfs track "*.safetensors"
git lfs track "*.ckpt"
git lfs track "*.parquet"
git lfs track "assets/**/*.pck"
git add .gitattributes
git commit -m "Track large files with LFS"

If you’d rather not run the CLI, or you’re scripting a fleet, the four config lines are all there is. Get them from the API:

Terminal window
curl -sS "https://cavsnode.com/api/v1/repositories/$REPO/connect" \
-H "Authorization: Bearer $CAVS_TOKEN" | jq
Response (abridged)
{
"repository_ref": "acme-ai/vision-models",
"endpoint": "https://cavsnode.com/api/v1/repositories/0f8c…",
"lfs_url": "https://cavsnode.com/api/v1/repositories/0f8c…/lfs",
"git_config": [
"git config lfs.standalonetransferagent cavs",
"git config lfs.customtransfer.cavs.path cavs-lfs-agent",
"git config lfs.customtransfer.cavs.concurrent false",
"git config lfs.url https://cavsnode.com/api/v1/repositories/0f8c…/lfs"
]
}
Terminal window
git lfs install --local
git config lfs.url "$LFS_URL"
git config lfs.standalonetransferagent cavs
git config lfs.customtransfer.cavs.path cavs-lfs-agent
git config lfs.customtransfer.cavs.concurrent false

Chunk-level dedup, range-resumed pulls, per-object physical stats, benchmarks.

Git LFS needs a credential for lfs.url. Easiest is the Git credential helper:

Terminal window
git config credential.helper store
# On the first transfer, enter any username and your CAVS token as the password.

Or set it non-interactively — useful in CI:

Terminal window
git config http.extraHeader "Authorization: Bearer $CAVS_TOKEN"
Terminal window
cav clone [email protected]:acme/vision.git --connect acme-ai/vision-models

Clones, then runs the connect flow inside the new working tree.

Terminal window
cav init my-project
cd my-project
# create the repository in the dashboard, then:
cav repo connect acme-ai/my-project
git lfs track "*.bin"
git add . && git commit -m "Initial commit"
git remote add origin [email protected]:acme/my-project.git
git push -u origin main

The pre-push hook keeps the index current, but you can drive it directly:

Terminal window
cav repo index --full # backfill all branches and tags
cav repo index # incremental, since the Hub's known heads
cav repo index --ref main --ref dev # specific refs only
cav repo index --dry-run # show what would be uploaded

Run --full after a history rewrite, after enabling indexing on an old repository, or when the dashboard’s Files tab looks stale. The hook is best-effort by design — it never blocks or fails a push.

Terminal window
git config --unset lfs.url
git config --unset lfs.standalonetransferagent
git config --unset lfs.customtransfer.cavs.path
git config --unset lfs.customtransfer.cavs.concurrent
git config --unset cavs.repo-id
git config --unset cavs.api-base
rm -f .git/hooks/pre-push # or edit out the `cav hook pre-push` line

Objects already stored stay in CAVS; nothing is deleted. Delete the repository if you want the bytes gone.