Reference
New to cliq? Do Get started first, then use this page as the flag bible.
cliq is a thin client. Almost every command talks to cliqd, the local daemon, so start cliqd first. cliq team validate and cliq team version work on local files and need no daemon.
cli/COMMANDS.md in the cliq repo.
Global options
Global options go before the command:cliq --verbose run.
Most commands also take
--json (machine-readable output). Commands that act on a workspace take -w, --workspace <ref> (workspace id, name or path; default: the current directory). Destructive commands take -y, --yes.
Exit codes
Environment
Auth & identity
cliq login [credentials...]
Log in to CliqHub through cliqd. cliqd must be running. cliqd keeps the session; the CLI stores nothing.
The first login also enrolls cliqd in a realm: the one you pass with --realm, your only realm, or one you pick from a list. Once enrolled, the realm is locked: a later login keeps it. To move cliqd, start it with --allow-realm-override and run cliq login --realm <org.slug>. Never do that while runs are in progress.
cliqd --hub <url> or CLIQ_API_URL.
cliq logout
Log out of CliqHub. cliqd keeps its daemon token and its realm; log in again with cliq login. Takes --json.
cliq whoami
Show the daemon identity (id, version, uptime, host), the CliqHub user, orgs, realms (* marks cliqd’s realm), team scopes and tokens. --json prints the full daemon status.
When CliqHub refuses a team because it is not on the realm’s team list, whoami lists it:
cliq setup
Guided setup: log in to CliqHub, set the Hub URLs, and configure agent credentials. Agent credentials are saved in cliqd, so start it first.
cliq auth token <name>
Create a CliqHub API token. Needs cliq login. The token is printed once.
Without --realm it is a durable user PAT (cliq_tok_…) for CI. With --realm it is a realm enrollment token (cliq_dt_…) for headless daemons.
cliq_tok_…) are accepted there.
cliq auth rotate-dispatch
Rotate a realm’s dispatch key pair and print the new public PEM (realm admins). Daemons in the realm pick up the new key on their next heartbeat.
Talking to a remote cliqd
By default the CLI talks to cliqd on127.0.0.1:4900 and needs no credential. To reach a cliqd on another host (or behind a Docker port mapping), set CLIQ_DAEMON_HOST / CLIQ_DAEMON_PORT and CLIQ_DAEMON_TOKEN. The token must be one that cliqd accepts:
- a local token (
cliq_…) minted on the machine running that cliqd (Local tokens), or - a user PAT (
cliq_tok_…) of a user in that cliqd’s realm, when cliqd is connected to CliqHub.
Agents
List local agents and register them on CliqHub. cliqd looks for agents onCLIQ_AGENTS_PATH (colon-separated), else the agents.path setting, and always adds ~/.cliqrc/agents last. Built-in agents ship with cliqd and refresh when you upgrade and restart it.
cliq agent list
List the agents on the local agents path (no CliqHub call unless --check-reg).
cliq agent info <name>
Show one agent: version, type, directory and manifest. Takes --json.
cliq agent register <name_or_path>
Register a local agent on CliqHub from its manifest. Pass an agent name on the agents path, or a path to the agent directory.
cliq agent unregister <name>
Remove an agent (or one version of it) from CliqHub.
cliq agent install, uninstall, update, reload or build. Built-in upgrades come with a new cliqd.
Configure credentials with cliq setup or cliq settings set agents.<name>.<key> <value>.
Creating a custom agent
Build agents with@getcliqio/cliq-sdk (GitHub Packages). The SDK handles the agent protocol; you implement phase handlers.
1. Install the SDK
@getcliqio/cliq-sdk · source: getcliqio/cliq-sdk.
2. Agent layout
manifest.json:
CLIQ_AGENTS_PATH, agents.path, or ~/.cliqrc/agents), then:
Workspace & runs
Each workspace command also exists undercliq workspace (cliq init = cliq workspace init, and so on).
cliq init [path] / cliq workspace init
Register a directory as a workspace (default: the current directory). Re-running on a registered directory is safe.
cliq status / cliq workspace status
Show a workspace: path, assembled teams, last and active runs. In a directory that is not a workspace, it lists every registered workspace.
cliq workspace list
List every workspace registered with cliqd: name, id, path, teams and last run.
cliq assemble <team_ref> / cliq workspace assemble
Bind an installed team (@scope/slug, see cliq team list) to a workspace. A workspace can hold several teams; cliq run -t picks one.
cliq disassemble <team_ref> / cliq workspace disassemble
Unbind a team from a workspace. The team stays installed. Takes -w and --json.
cliq workspace delete
Deregister a workspace from cliqd and the CliqHub catalog. Files on disk are kept, and so are its runs (still in cliq logs and CliqHub). Refused while a run is in progress there. Removal from the CliqHub catalog is best effort (only when cliqd is enrolled).
cliq clean / cliq workspace clean
Delete a workspace’s finished runs. Keeps the workspace, its teams and active runs. To deregister the workspace, use cliq workspace delete. Takes -w and --json.
cliq run [run_id] [phase]
Run the workspace’s team and stream its progress. With run_id and phase, rerun that run from the phase instead.
Exit code
0 when the run completes, 1 when it fails, 3 when inputs are missing. Follow a run later with cliq logs -f.
cliq run warns that it won’t appear in CliqHub yet:
--json the same text is in the warnings array. See How teams get installed.
cliq logs [run_id]
Show a run’s log (default: the latest run, with its sub-runs), list recent runs, or follow live.
Outbox (daemon → Hub delivery queue)
cliqd queues every state change bound for CliqHub (runs, teams, workspaces, events) in a durable SQLite outbox. It ships them in order, with retry and exponential backoff. When something upstream breaks (Hub outage, revoked auth, schema drift), entries pile up and can run out of retries. They are then dead. Runs of a team that is not on the realm’s team list are held back on their own. They do not block other teams’ runs. See How teams get installed. There is nocliq outbox command and no admin API for the outbox. cliqd emits daemon.outbox.dead and daemon.outbox.recovered into the Hub event catalog when the dead count changes. Wire notification rules on those types for alerts.
Teams (daemon catalog)
A team ref is@scope/slug. A team directory holds team.yml (plus roles/, dependencies.yml, Dockerfile).
cliq team install <source>
Install a team into cliqd’s catalog from CliqHub (@scope/slug[@version]) or a directory (./dir, ../dir, /abs/dir). Teams outside the @local scope (also from directories) need cliq login.
cliq team uninstall <team_ref>
Remove a team from the catalog. Workspaces using it lose it.
cliq team list [scope]
List the installed teams, grouped by scope. Pass a scope (without the @) to filter. Takes --json (includes manifests).
cliq team info <team_ref>
Show an installed team’s metadata and manifest. Takes --json.
cliq team update <team_ref>
Replace an installed team’s manifest from its source directory. Reinstall from a directory with cliq team install <dir> --force for a full replacement.
cliq team export [team_refs...]
Write installed teams to disk, one folder per team (team.yml, Dockerfile, dependencies.yml). Edit the files, then install them again with cliq team install ./<dir>.
cliq team validate [dir]
Check a team directory: team.yml, its file:// references and dependencies. Defaults to the current directory. No daemon needed. Exit code 1 when anything is invalid. Takes --json.
cliq team version [dir]
Print the version in a team directory’s team.yml, or bump it. No daemon needed. Only the version line changes; comments and formatting are kept.
cliq team publish <dir>
Publish a team directory to CliqHub. It does not install it locally. Publishing an already-published version is skipped (exit 0); bump it with cliq team version <dir> --patch.
Instances
List, inspect and stop runs on this daemon.run_id is a run id or name. cliq instance stop marks the run cancelled and stops its work right away: the running agent process, any wait for inputs, and active sub-team runs. Cancelling from CliqHub does the same.
Settings & doctor
cliq settings
Read and write settings. Everything is stored in cliqd; there is no ~/.cliqrc/settings.json.
Keys under agents., hub., hub_connect., daemon., logging., cliq. and other daemon prefixes are daemon-wide. Any other key is a secret of the workspace in the current directory.
A few keys are handled specially:
cliq login keeps its session in cliqd (hub.session, never listed).
Options of
cliq settings itself go before a subcommand (cliq settings --json); get and set have their own.
agents.jira.api_token, agents.cursor.api_key, …) are daemon settings. Required keys per agent: Agents.
cliq doctor
Check cliqd, agents, workspaces and teams, and say what to fix. Exit code 1 when a check fails. --json prints the raw result.
Related
- The daemon → cliqd
- Local development → Local Development
- Credentials → Auth
- Logs on disk → Logging