Installing and using the `collab` CLI
Pull a working copy locally, edit files, and push commits back.
1. Get a token
Create a
repo:writepersonal access token and export it asCOLLAB_TOKEN(or pass--token).2. Set the server URL
Export
COLLAB_URLto your Collaborate instance (defaults tohttp://localhost:3035for local dev).3. Pull a repository
First-time Windows setup: on the repo page click Get a local copy and run
get-{repo}.cmd. Pick an empty folder and paste your PAT in the popup. That downloads the branch tip and writes.collab/state.json. The CLI equivalent iscollab pull owner/repo [branch] --dir ./my-copy. Download ZIP is a file snapshot only and cannot push later.4. Check sync status
Run
collab status --dir ./my-copyto see whether your local tip matches the remote tip and whether you have unpushed file changes. Exit code 2 means you are behind and should pull before pushing.5. Connecting a brand-new, still-empty repository
A repository with zero commits has nothing to download, so
collab pullreturns a 404. Runcollab init owner/repo [branch] --dir ./my-projectinstead — it writes.collab/state.jsonwithout contacting the server, tracking the folder against that branch. From an empty repository page, the Show me how card gives you a ready-to-paste prompt for this.6. Push changes
Edit files locally, then
collab push owner/repo [branch] -m "Your message" --dir ./my-copy. Push fails with exit code 1 if the remote branch moved — runcollab status, thencollab pull, reconcile, and push again. Aftercollab init, the first push becomes that branch's root commit.7. Offline commits with local journal
You can make discrete commits while offline or disconnected: run
collab commit -m "Describe discrete step" --dir ./my-copy. Collaborate writes the commit snapshot into.collab/journal.jsonwithout contacting the server. Runcollab journal listto inspect your queued offline commits (orcollab journal clearto discard). When you reconnect or are ready to sync, runcollab push owner/repo [branch]— Collaborate transfers each journaled commit in chronological order with individual commit messages preserved on the server.8. Sign commits cryptographically
Generate an Ed25519 signing key with
collab key generate, register it withcollab key add <pubKeyFile> --label "My Key"(or in Profile → Ed25519 Commit Signing Keys), and pass--sign-key <privKeyPath>(or setCOLLAB_SIGN_KEY) tocollab commitorcollab push. Collaborate verifies the commit and displays a green Verified badge.9. Team path
Prefer a feature branch + pull request into the default branch. Protect
mainwhen multiple developers share a repo. See Sync vs deploy.10. Help output
Run
collab --helpto see the full usage summary for pull, push, and status flags.
