--- title: connect / disconnect description: Connecting a node to ClawMetry Cloud — every flag on connect, the ownership OTP, deferred sync, key-only mode, and how to cleanly disconnect. keywords: clawmetry connect, clawmetry cloud sync, clawmetry disconnect, agent cloud dashboard eyebrow: CLI reference --- # `clawmetry connect` / `disconnect` Activate or stop cloud sync for this node. ```bash clawmetry connect --key cm_xxx clawmetry disconnect ``` Connecting does not change what ClawMetry observes or how. It adds one thing: the daemon builds an encrypted snapshot and pushes it upward. Session content is AES-256-GCM encrypted before it leaves the machine — [End-to-end encryption](/docs/cloud/encryption/) has the field-level detail. ## `connect` flags | Flag | Effect | |---|---| | `--key cm_xxx` | API key, skipping the prompt | | `--enc-key KEY` | Encryption key, skipping the prompt. For automated and sandbox use. | | `--node-id NAME` | Custom node name (default: the hostname) | | `--start-sync-now` | Skip the ownership OTP and start syncing immediately | | `--defer-sync` | Connect but leave sync paused; start it later with `clawmetry sync` | | `--no-daemon` | Connect but do not start the daemon — you supervise it externally | | `--key-only` | Save key and configuration only, do not start the daemon | | `--force` | Override the persistent local-only marker and connect anyway | | `--foreground` | Run the daemon in the foreground | ## The ownership OTP Connecting a node to an account is a claim of ownership, so by default it is verified with a one-time code. The command you copy out of the dashboard already carries `--start-sync-now`, because in that flow the browser session has already proved who you are. Sync-on-connect is the default; `--start-sync-now` only skips the verification step. ## Deferring sync ```bash clawmetry connect --key cm_xxx --defer-sync # later, when you are ready for data to move: clawmetry sync ``` Useful when provisioning a machine before it has anything worth syncing, or when you want the configuration in place but the data flow gated on a separate approval. ## Key-only and no-daemon Two different things: - `--key-only` writes the key and configuration and stops. Nothing is started. - `--no-daemon` completes the connect but leaves the daemon for your own supervisor to run. Use `--no-daemon` under supervisord or a systemd unit you maintain; use `--key-only` when a host process handles the lifecycle entirely. ## Self-hosted endpoints ```bash CLAWMETRY_ENDPOINT=https://clawmetry.internal.example.com \ clawmetry connect --key cm_xxx ``` → [Self-hosted ingest](/docs/cloud/self-hosted/) ## `disconnect` ```bash clawmetry disconnect ``` Stops cloud sync and removes the key. Your local store is untouched — every session, every event, all of your history stays exactly where it was. The dashboard keeps working; it simply stops pushing. ## `account` ```bash clawmetry account ``` Shows the account this node is attached to, or links an email address to it. ## Checking state ```bash clawmetry status --json | jq '{cloud, node_id, endpoint, last_push}' clawmetry status --show-key # reveal the secret key ``` `--show-key` prints a credential to your terminal. Be deliberate about where.