C3Sync / Reference
Updated 2026-07-24 · c3sync command definitions
CLI reference
Two binaries ship together: c3sync (the CLI) and c3syncd (the daemon, normally run as a service). Run c3sync <command> --help for full flag detail on your installed release.
Setup and enrollment
| Command | Purpose |
|---|---|
c3sync setup | Guided wizard: host a hub or join one. Flags (--role, --handle, --hub-url, --tls-pin, --creds, --passphrase, --yes) pre-answer prompts |
c3sync join | Shorthand for setup --role join |
c3sync init --handle <h> --tls-pin <pin> | Manually initialize the first device (managed mode requires the pin) |
c3sync login --handle <h> --hub-url <url> --tls-pin <pin> --creds <file> | Enroll another device via PAKE; an enrolled responder must be online. Reads the passphrase from stdin when piped |
c3sync daemon install | uninstall | status | Manage c3syncd as a native background service (captures keystore env into a 0600 env file; enables user lingering) |
Projects and synchronization
| Command | Purpose |
|---|---|
c3sync enable [path] | Start syncing a project (agents auto-detected; non-git folders sync transcripts only) |
c3sync disable [path] | Stop syncing; synced state and clocks are kept |
c3sync status | Enrollment, per-project backlog, conflicts, git position, and deletion holds |
c3sync sync [path] [--confirm-deletions] | Flush immediately; --confirm-deletions approves a held bulk deletion for this flush |
c3sync materialize [path] | Force a full native write-back pass (idempotent) |
c3sync reconcile [path] | Fetch + fast-forward this repo to pushed upstream history — see git integration |
Conflicts and recovery
| Command | Purpose |
|---|---|
c3sync conflicts list [path] | Unresolved file conflicts and co-edited sessions |
c3sync conflicts resolve <file> [path] | Clear a conflict and remove its .conflict sidecar |
c3sync checkout --list [path] | List restorable turns, newest first |
c3sync checkout <turn> [--force] [--yes] | Rewind the working tree to a turn; prints an undo turn |
Devices and keys
| Command | Purpose |
|---|---|
c3sync devices | This device plus every device admitted here (friendly hostnames; USER PUB feeds revoke) |
c3sync devices remove <user-pub> | Drop a registry row (ghost entries) — cosmetic, does not revoke |
c3sync rekey [--passphrase-new] | Rotate the tenant secret and enrollment passphrase; bumps the key epoch |
c3sync revoke <user-pub> | Full lost-device ceremony: cut transport creds, rekey content, re-enroll survivors |
Hub administration
The hub serves the whole C3 suite — C3Sync devices on port 4222 and C3 Mobile phones on the 8443 WebSocket listener — in isolated accounts.
| Command | Purpose |
|---|---|
c3sync hub init --handle <h> --host <host> | Create the trust chain, TLS CA + cert, and NATS config (--listen, --ws-listen, --dir to customize) |
c3sync hub run | Run the embedded NATS + JetStream hub in the foreground |
c3sync hub install | uninstall | status | Run the hub as a boot-time background service |
c3sync hub mint-enroll [--out enroll.creds] | Mint reusable enrollment credentials for new devices |
c3sync hub revoke --device <user-pub> | Cut one device's NATS credentials at the hub |
c3sync hub backup [--out <file>] | Seal the hub trust chain under the master passphrase (offline recovery) |
c3sync hub restore [--in <file>] | Promote this device to hub admin from a sealed backup |
c3sync hub export | import <archive> | Pack / unpack the portable serving bundle (config, public JWT, TLS files — never secrets or message data) |
c3sync hub control … | Enroll and manage C3 Mobile phones and C3 Bridge hosts — see the mobile hub reference |
c3sync hub tls renew-leaf | Rotate the serving certificate under the same CA (pin unchanged) |
c3sync hub tls rotate-ca --confirm-re-enroll-all | Replace the CA entirely; every phone/bridge re-enrolls |
Configuration
~/.c3sync/config.json (0600):
| Key | Meaning |
|---|---|
handle | Your identity; names the enrollment rendezvous |
mode | managed (embedded hub) or external (bring-your-own NATS) |
nats_url | Where the daemon dials the hub |
tls_pin | SHA-256 pin of the hub certificate |
epoch | Current tenant-secret generation (bumped by rekey/revoke) |
keystore | auto (OS keyring) or file (encrypted file backend) |
git_ssh_key | Optional pinned SSH identity for auto-pull fetches |
node_id | HLC tiebreak identity — generated once; never hand-edit |
Environment variables
| Variable | Effect |
|---|---|
C3SYNC_HOME | Override the config root (default ~/.c3sync) |
C3SYNC_KEYSTORE_FILE | Force the encrypted-file keystore backend |
C3SYNC_KEYRING_PASSWORD | Password for the file keystore (required with it; no default) |
C3SYNC_DEBUG | Verbose daemon logging |
C3SYNC_POLL_INTERVAL, C3SYNC_DISCOVERY_INTERVAL | Daemon timer tuning |
c3sync daemon install snapshots these into the service's private env file, so headless keystore settings survive reboots.