Skip to content

Connect Your Agent

Connecting your agent to Clonit Cloud unlocks team collaboration, cross-device access, and snapshot sharing. This page walks through the one-time setup: tell the agent where the cloud lives, authenticate, and confirm everything works. (Registering the agent — Step 3 — is itself optional; it’s only for remote management.)

You need:

  • A Clonit Cloud URL for your deployment (for example https://cloud.clonit.ai, or your team’s self-hosted address).
  • A way to authenticate, either:
    • As a human: sign in through your browser with clonit login, or
    • For automation (CI/CD): a Clonit Cloud API key (cloud.api_key).

You do not need to create a separate password for Clonit. Identity is handled by an external sign-in service — Clonit never stores your password.

The agent only talks to the cloud when cloud.url is set. Open your config file in your editor:

clonit config edit

This opens config.yaml in $VISUAL, $EDITOR, or vi. Add (or fill in) the cloud section:

cloud:
url: "https://cloud.clonit.ai" # your Clonit Cloud deployment
api_key: "" # leave empty if you'll sign in with `clonit login`
agent_id: "" # set automatically after registration

Save and close the editor.

How you authenticate depends on whether a person or an automated job is running the agent.

Sign in interactively through your browser:

clonit login

Clonit runs an OAuth 2.0 Device Authorization Grant (RFC 8628): it prints a short code and a URL, opens your browser, and waits for you to approve the sign-in. Once approved, your session is saved locally and refreshed automatically. No API key or password is ever typed into the terminal.

Only cloud.url needs to be set — Clonit discovers the sign-in service from the cloud for you. Over SSH or in a headless shell, add --no-browser to print the verification URL instead of opening a browser:

clonit login --no-browser

CI/CD pipelines and other headless jobs should not use interactive login. Instead, give the agent a Clonit Cloud API key via cloud.api_key (set in the config file from Step 1, or through CLONIT_CLOUD_API_KEY). An organization admin issues these keys — see API Keys for how to create and manage them.

With an API key configured, the agent authenticates automatically on every cloud command — no clonit login step is required.

By default an org API key has full org access — it can list every cloud target, retrieve any target’s connection config, and pull any snapshot. A CI/CD agent rarely needs all of that. Instead, mint it a target-scoped, pull-only key:

clonit cloud api-keys create --name ci-pull \
--scope-target proddb --permissions pull

A key scoped with --scope-target is confined to a strict allowlist: target listing, config retrieve, and snapshot pulls only reach the targets in the scope — everything else in the org is invisible to that key. Snapshot push is allowed only when the key is unscoped or the target is in the scope; a key scoped only to SSO groups grants no push at all. --permissions pull additionally blocks uploads even for in-scope targets.

If a scoped key leaks, the blast radius is one pipeline’s targets — not the org. See clonit cloud api-keys for the full command reference.

Step 3 (optional) — Register for remote management

Section titled “Step 3 (optional) — Register for remote management”

You can skip this step. Pushing, pulling, sharing, and every other day-to-day cloud operation work with just Steps 1–2. Registration exists for one thing: letting Clonit Cloud remotely manage this machine — it appears in the fleet list (Settings → Organization → Registered Agents in the web UI) and can receive cloud-relayed commands (the agent holds an outbound connection; the cloud pushes work down it). CI runners and one-off laptops generally don’t need it.

Register only if you want this machine remotely controllable:

clonit cloud register

By default the agent is named after your machine’s hostname. Give it a clearer name if you like — useful when several agents (laptops, CI runners) connect to the same organization:

clonit cloud register --name ci-runner-01

If the agent is already registered and you need to re-register it, pass --force:

clonit cloud register --force

Registration writes the assigned agent_id back into your config file automatically — you don’t need to set it by hand.

Flag Default Description
--name hostname Name to register this agent under
--force false Re-register even if already registered

Confirm two things: who you’re signed in as, and that the agent can reach the cloud.

clonit whoami

This shows the identity currently signed in to Clonit Cloud and validates your stored session, refreshing the access token if needed. It’s the companion to clonit login and clonit logout.

clonit cloud status

This reports the agent’s cloud connection status — the configured cloud URL, whether the agent is registered, and whether it can reach the cloud API.

A healthy setup looks like this end to end:

clonit config edit # set cloud.url (Step 1)
clonit login # sign in via your browser (Step 2)
clonit whoami # confirm your identity
clonit cloud status # confirm the agent is connected
clonit cloud register # OPTIONAL (Step 3) — only for remote management
  • whoami says you’re not signed in — run clonit login again. Interactive sessions expire and can be cleared with clonit logout.
  • CI job fails to authenticate — make sure cloud.api_key (or CLONIT_CLOUD_API_KEY) is set in that environment. Do not rely on an interactive clonit login session inside automation.
  • Registration says the agent already exists — that’s fine; the agent is already known to the cloud. Use clonit cloud register --force only if you intend to re-register it.

With the agent connected, you can use the rest of Clonit Cloud: