Usage & Features
Cloud Sync
On this page
Chain Hub uses Git behind the scenes to securely synchronize your entire instruction library, rule presets, agents, and workflows across multiple devices.
Unlike typical cloud folders (like Dropbox, iCloud, or Syncthing) which can corrupt git history, lock files, or propagate accidental deletions, Chain Hub’s synchronization model is built on standard Git branching and conflict resolution.
How it works
When you initialize sync, the CLI turns your active hub path (~/chain-hub) into a local Git repository and binds it to a private remote repository of your choice.
The Synchronized Architecture:
- Local Repositories: Your hub directory on each machine (e.g. Laptop A and Laptop B) acts as a local Git repository tracking your rules and assets.
- Private Central Remote: A central, private repository (hosted on GitHub, GitLab, etc.) securely stores the revision history.
- Rebase Integration: Devices synchronize by pushing local updates and pulling/rebasing upstream commits from the remote repository.
During a sync event:
- The CLI stages and commits any new or changed assets in your hub.
- It fetches upstream changes from your remote.
- It performs a fast-forward merge or rebase to integrate changes from other devices.
- It pushes your commits to the remote.
Get started in the hub (recommended)
The easiest way to set up sync is from the local dashboard (chain hub).
-
Open Skills (or the dashboard) and click Sync.
-
If your hub is not yet a Git repository, choose Initialize local repository.
-
When no remote is configured, click Set up GitHub sync.
-
Install the GitHub CLI if prompted, then Sign in with GitHub (opens a browser login via
gh auth login --web). -
Choose one of two paths:
Create new repo — for your first machine or a fresh backup:
- Enter a repository name (default:
chain-hub). - Click Create Chain Hub repo.
- Chain Hub creates a private GitHub repository, sets
origin, and pushes your hub as the first commit.
Link existing repo — when you already sync Chain Hub on another device:
- Pick your existing repository from the list (likely Chain Hub repos appear first), or paste
owner/repoor the full HTTPS/SSH URL. - Click Link Chain Hub repo.
- Chain Hub sets
originwithout overwriting the remote history. Run Sync Now to pull or push.
- Enter a repository name (default:
-
Click Sync Now whenever you want to upload local changes or download updates from other machines.
Another Git host? In the GitHub setup panel, use Use another Git host to paste a remote URL manually (GitLab, self-hosted, etc.). You still need Git credentials configured in your shell for push and pull.
After linking on a second machine, run chain setup and chain validate so IDE symlinks and the registry match the pulled hub content.
Get started from the CLI
You can also configure sync entirely from the terminal — useful for scripts, SSH-only workflows, or non-GitHub remotes.
- Create a private remote repository on GitHub, GitLab, or any Git host (or use an empty repo you already created).
- Authenticate your environment — SSH keys,
gh auth login, or an HTTPS token with push access. - Initialize synchronization:
- Run a sync cycle:
- Check status:
chain sync init:
- Runs
git initin your hub if needed - Ensures
.gitignorefor machine-local files (for examplebrain.db*,.chain/active-project.json) - Sets
originto your URL
Day-to-day
| Action | Hub | CLI |
|---|---|---|
| Full sync (commit, pull/rebase, push) | Sync Now in the Sync modal | chain sync |
| Connection health | Sync modal status panel | chain sync status |
| Change remote | Edit remote or re-run GitHub setup | git remote set-url origin <url> |
The Sync modal shows whether your branch is clean, ahead, behind, or has local changes. If there is no remote, status will say so explicitly — it will not claim you are “in sync” with a remote that does not exist.
Synchronization Best Practices
[!WARNING] Do NOT run external file synchronization utilities (like Syncthing, Dropbox, Resilio Sync, or OneDrive) on your active hub directory in parallel with Git sync. Doing so can cause working-tree locks, merge conflicts, and accidental file overrides.
- Private Repositories Only: Your hub contains personal preferences, codebase instructions, and possibly project rules. Always keep your sync repository private.
- One sync system: Use either Chain Hub Git sync or a folder sync tool on
~/chain-hub— never both. - Run Setup After Sync: If you pulled down changes that added or updated adapter plugins, run
chain setupto update your IDE symlinks. - Sync Configuration: Machine-specific paths (like editor config paths in
~/.config/chain-hub/config.json) are not synchronized; they remain completely local to each device.
Troubleshooting
GitHub setup says “Install GitHub CLI”
Install gh from cli.github.com, then sign in from the Sync modal or run:
Create failed because the repository already exists
Switch to Link existing repo in the hub and select that repository, or use the CLI with chain sync init and your existing remote URL.
Private GitHub pack install fails (separate from hub sync)
Hub sync uses gh for repository setup; pack installs accept GITHUB_TOKEN, GH_TOKEN, or gh auth token. See Troubleshooting for pack install details.