# CLI

> For the complete documentation index, see [llms.txt](https://docs.lertha.com/llms.txt).
> Any documentation page is available as raw Markdown by appending `.md` to its URL.

> The lertha command line: tasks, flows, queues, namespaces and a local dev orchestrator.

`lertha` is the orchestrator's command line. It speaks the same words as the port and the UI.

## Install

Download the binary for your platform from the orchestrator's releases and put it on your
`PATH`, or build it from the orchestrator repository:

```bash
make lertha        # in lertha-flow; produces bin/lertha
```

On first use it fetches its core into `~/.lertha/bin` (about 30 MB, once). Nothing else to install.

## Connect

```bash
export LERTHA_ADDRESS=engine.lertha.com:7233
export LERTHA_NAMESPACE=lertha        # default: "default"
```

Any command also accepts `--address` and `--namespace` directly.

## Tasks

```bash
# run a task and wait
lertha task run --type ComposeGreeting --id greet-1 --queue lab --timeout 10s \
  --input '{"greeting":"Hello","name":"CLI"}'

# start without waiting, then look
lertha task start --type ComposeGreeting --id greet-2 --queue lab --timeout 10s --input '{"greeting":"Hi","name":"Ada"}'
lertha task describe --id greet-2
lertha task list --query 'ActivityType = "ComposeGreeting"'
lertha task cancel --id greet-2 --reason "operator"
```

`--timeout` is the attempt budget and `--overall` the whole-run budget, the same two budgets as
`RunOptions`. `--heartbeat` sets the heartbeat timeout.

## Flows

```bash
lertha flow describe --id agent-42
lertha flow history --id agent-42            # the recorded event history
lertha flow signal --id agent-42 --name approval --input '{"approved":true,"by":"cli"}'
lertha flow result --id agent-42
lertha flow list --query 'WorkflowType = "AgentRun"'
lertha flow cancel --id agent-42
```

## Queues and workers

```bash
lertha queue describe --name lab             # who is polling, and with which build
```

If this lists more workers than you expect, you have version skew. See
[Determinism](/concepts/determinism).

## Namespaces and the cluster

```bash
lertha namespace list
lertha namespace describe lertha
lertha cluster                               # core version and capabilities
```

## Local dev orchestrator

```bash
lertha dev                                   # in-memory; UI on :8233, gRPC on :7233
lertha dev --db lab.db                       # persists across restarts
```

## Everything else

`lertha` renames what has a Lertha word and passes every other flag through unchanged, so the
full core command set is reachable. `lertha help` lists the vocabulary; `lertha raw -- ...`
hands the arguments to the core untouched:

```bash
lertha raw -- workflow list --limit 5
```

The [Vocabulary](/reference/vocabulary) page maps the words in both directions, which is also
how to read the core's own `--help` output.
