# The werker CLI

> Start and follow Werker work from a terminal, or let your own agent do it with an API key.

Source: https://werker.cloud/docs/cli (updated 2026-12-01)

`werker` starts, follows and stops work in a Werker, from a terminal
or from an agent such as Claude Code. Your agent shapes the request
with you, then hands it over.

It is not on npm yet. From Werker's source:
`pnpm --filter @werkerai/cli build`, then
`node apps/cli/dist/index.js`.

## Signing in

Make a key in **Settings → API keys**
([API keys](users-and-access.md#api-keys)), then pipe it in, so it
stays out of your shell's history:

```sh
werker login --url https://werker.example.com < key.txt
werker whoami
```

Or set `WERKER_URL` and `WERKER_API_KEY`. A saved key is only sent to
the address it was saved for, over HTTPS or to your own machine.

## Using it

| Command                               | What it does                                    |
| ------------------------------------- | ----------------------------------------------- |
| `werker guide`                        | Tells an agent how to use it                    |
| `werker context`                      | Lists models, connections and saved work        |
| `werker run --file request.md`        | Starts work, prints the run's ID and returns    |
| `werker run --agent <id>`             | Runs a saved agent (or `--workflow`)            |
| `werker runs list`, `get`, `follow`   | Reads runs                                      |
| `werker runs cancel`, `rerun`         | Stops a run, or runs its saved work again       |
| `werker answer <run> "…"`             | Answers a run that asked, if the key may        |
| `werker files list`, `get`            | Downloads what a run made (`project` for a zip) |
| `werker factory list`, `show`, `read` | Reads factories and their rooms                 |
| `werker factory send`, `stop`         | Sends a message to a room, or stops its work    |
| `werker call --list`                  | Lists every operation; `call <name>` runs one   |

It never asks for anything: text comes from words, `--file` or stdin,
and `--json` prints JSON. Work starts without the questions **New**
asks. With more than one model, name one with `--model`.

## Exit codes

| Code | Meaning                              |
| ---- | ------------------------------------ |
| 0    | Done                                 |
| 1    | It failed, or the run did            |
| 2    | The command was used wrongly         |
| 3    | The run is waiting for an answer     |
| 4    | The key is missing, or may not do it |
| 5    | Still going when the time ran out    |

## What has been tested

On one machine, against a development Werker: signing in, reading,
refusals, starting a described agent, following it, and downloading
its file and project. Answering a run, factories and running saved
work have only been tested with made-up servers or not at all.

## Not built

- Sending files to a run.
- Following a factory's room; read it again instead.

An assistant that speaks MCP can connect without the CLI
([MCP](mcp.md)).
