Architecture
A realm is a fleet boundary on CliqHub: an org.slug namespace that owns daemons, teams, runs, and a team list. Every daemon belongs to exactly one realm (or none, if running locally).
One daemon, one realm
When you runcliq login, cliqd enrolls in a realm and stays there:
- cliqd registers with CliqHub and heartbeats every 30 seconds.
- Runs, teams, workspaces, and events sync to the realm.
- The realm is locked — a subsequent
cliq loginkeeps the same realm.
Local mode (no realm)
A daemon without a login has no realm. It runs entirely locally:- No CliqHub enrollment, no sync, no outbox delivery.
- Teams install under
@localscope. - HUG gates use the local review API instead of CliqHub.
- Everything works — you just don’t see runs in the CliqHub dashboard.
Switching realms
The realm is locked after enrollment. To move a daemon to a different realm:- Start cliqd with
--allow-realm-override(orCLIQ_ALLOW_REALM_OVERRIDE=1):
- Log in to the new realm:
Logging out
cliq login to restore the session.
Going from local to enrolled
When a daemon in local mode runscliq login:
- cliqd enrolls in the realm and gets a daemon token.
- All local teams, runs, and workspaces are cleared — the daemon starts fresh in the realm.
- cliqd restarts in place and begins syncing with CliqHub.
Going from enrolled to local
Starting an enrolled daemon with--no-login (or --standalone):
- cliqd warns that you were previously enrolled.
- If you confirm (or pass
--yes), all teams, runs, and workspaces from the realm are cleared. - cliqd starts in local mode.
Realm team list
A realm has a team list: the set of teams that Hub pushes to every daemon in the realm. When a daemon enrolls, Hub installs the team list onto it automatically. When a realm admin adds a team to the list, Hub fans the install to all online daemons. You can also install teams locally withcliq team install. A locally-installed team that isn’t on the realm’s team list still runs, but its runs don’t sync to CliqHub until a realm admin adds it.
To resolve unsyncable teams:
Hub API
Realm management is done through the CliqHub web UI or the Hub API. See the Hub API tab → Realms for the full API reference:
Enroll tokens:
POST /v1/auth/generate_token with { "type": "realm", "realm_id": "…" }, or cliq auth token <name> --realm <realm_id>.
Related
- Local dev workflow → Local Development
- CLI commands → CLI
- Daemon options → cliqd
- Credentials → Auth