> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcliq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Running teams

> Install, assemble, provide inputs, run, inspect, and resume Cliq teams on the daemon.

A **run** executes an assembled team’s phases on the **daemon**. The CLI starts the run and streams status; it does not orchestrate phases itself.

Vocabulary: [Concepts](/concepts). Agent catalog: [Agents](/agents). First install: [Get started](/get-started).

***

## Lifecycle

```text theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq init
  → cliq assemble <team-ref>
  → cliq run [-i key=value ...]
  → cliq status / cliq logs
```

Optional: `cliq team install …` if the team is not already in the local catalog.

***

## 1. Workspace

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
mkdir my-project && cd my-project
cliq init
# or: cliq init --name my-project
```

`init` registers the current directory as a workspace with the daemon. Re-running it is safe.

***

## 2. Assemble a team

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq assemble @cliq/hello-world
```

Assemble **binds** a catalog team to this workspace. The daemon validates the manifest (phases, agents, DAG, nested teams).

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq assemble @cliq/hello-world -w ~/other-project
cliq assemble @acme/release-review -w <workspace-id>
```

`-w, --workspace` takes a workspace id, name or path. If several teams are assembled in one workspace, pick one at run time with `--team`.

***

## 3. Provide inputs

Teams declare what they need (task text, folder URLs, tickets, …). Pass values at run time:

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq run -i task="Write a haiku about programming"
cliq run -i message="Hello" -i ticket=PROJ-123
```

`-i` / `--input` is repeatable (`key=value`). When required inputs are missing, `cliq run` lists them and exits with code `3` — supply them and run again.

Some demo teams need no inputs (`@cliq/hello-world`).

***

## 4. Run

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq run
cliq run --name my-feature
cliq run -t @cliq/hello-world
cliq run -w ~/my-project
cliq run --no-stream          # return once the run starts; watch with status/logs
```

| Flag | Purpose |
| - | - |
| `-n, --name` | Name for the run (generated when omitted) |
| `-t, --team` | Team ref when several are assembled |
| `-w, --workspace` | Target workspace by id, name or path |
| `-i, --input` | Run input (`key=value`, repeatable) |
| `--label` | A label recorded with the run (`key=value`, repeatable) |
| `--context-id` | External correlation id; reuses the active run with the same id |
| `--no-stream` | Return once the run starts instead of streaming its events |
| `--json` | Print the started run as JSON (implies `--no-stream`) |

`cliq run` exits `0` when the run completes and `1` when it fails.

The daemon:

1. Resolves the assembled team and inputs
2. Walks `depends_on` and invokes each phase’s agent
3. Stores each phase **output** as a run **artifact** and passes predecessors as **upstream**
4. For gates: runs `commands`, then asks for **PASS / ROUTE / ESCALATE**

***

## 5. Inspect

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq status                 # current workspace / latest run
cliq status --all           # all registered workspaces
cliq status -w my-project

cliq logs
cliq logs -f                # follow
cliq logs --last 5
```

Status shows phase progress. Logs show orchestrator and agent output for the run.

***

## Stop a run

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq instance list
cliq instance stop <run_id>
```

Stopping cancels the run and kills its running agent process right away; active sub-team runs are cancelled too. Cancel in CliqHub does the same.

***

## Runs in CliqHub

When the daemon is logged in to a realm, its runs sync to CliqHub. A team must be on the realm's team list for that. If it isn't, the run still executes on your machine, and `cliq run` warns:

```text theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
This run won't appear in CliqHub: @acme/my-team isn't installed in this realm. It runs here and syncs once a realm admin adds the team to the realm in CliqHub.
```

Only that team's runs wait; other teams keep syncing. `cliq whoami` lists the waiting teams. Fix it by having a realm admin add the team to the realm, or by uninstalling it (`cliq team uninstall`). Details: [cliqd — How teams get installed](/cliqd#how-teams-get-installed).

***

## 6. Resume / rerun a phase

Re-enter an existing run from a named phase (later phases re-execute; earlier outputs are reused when available):

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq run <run_id> <phase_name>
```

`run_id` is a run id or name. Start-only flags (`--name`, `--team`, `-i`, `--label`, …) are ignored when rerunning.

Example:

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq run bold-arch writer
```

***

## Configure agents before AI teams

LLM and connector phases need settings on the daemon:

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq setup
# or
cliq settings set agents.cursor.api_key <key>
cliq settings set agents.jira.base_url https://yoursite.atlassian.net
```

Check readiness:

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq doctor
cliq agent list
```

Details per agent: [Agents](/agents).

***

## Multi-workspace and remote

| Goal | Command / path |
| - | - |
| Run in another workspace | `cliq run -w <name-or-path>` |
| CI calling Hub | User token — [Auth](/auth) |
| Enroll another machine | Realm enroll token (`cliq auth token <name> --realm <realm_id>`) → `CLIQ_DAEMON_TOKEN` for its cliqd |
| Drive a cliqd on another host | `CLIQ_DAEMON_HOST` + `CLIQ_DAEMON_TOKEN` — [CLI](/cli#talking-to-a-remote-cliqd) |
| Hub-dispatched run | Hub API / BFF dispatch |

Local `cliq run` talks to the **local daemon** by default.

***

## Minimal examples

**No API keys**

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
mkdir ~/cliq-hello && cd ~/cliq-hello
cliq init
cliq assemble @cliq/hello-world
cliq run
cliq status
cliq logs
```

**Cursor AI team**

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
cliq settings set agents.cursor.api_key <your-cursor-api-key>
mkdir ~/cliq-cursor && cd ~/cliq-cursor
cliq init
cliq assemble @cliq/hello-world-cursor-gate
cliq run -i task="Write a haiku about programming to haiku.txt"
cliq logs
```

***

## Next

| | |
| - | - |
| [Concepts](/concepts) | Phases, agents, gates, upstream |
| [Agents](/agents) | Built-ins and input params |
| [CLI](/cli) | Full command reference |
| [Auth](/auth) | Tokens and realms |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.