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. Team path
Prefer a feature branch + pull request into the default branch. Protect
mainwhen multiple developers share a repo. See Sync vs deploy.8. Help output
Run
collab --helpto see the full usage summary for pull, push, and status flags.
