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

# Cyberun CLI

> Run your team workflows from the terminal with the cyberun command-line tool.

The `cyberun` CLI runs your team's workflows from a terminal: submit
a task, poll it to completion, download the result, and manage
agents — without leaving the shell. It's the scripting companion to
the dashboard, useful for local experiments, cron jobs, and CI.

The CLI ships on its own release track, separate from the dashboard,
so its version moves independently.

## Install

<CodeGroup>
  ```bash Linux / macOS theme={null}
  curl -sL https://releases.cyberun.cloud/cli/install.sh | bash
  ```

  ```powershell Windows theme={null}
  & ([scriptblock]::Create((irm https://releases.cyberun.cloud/cli/install.ps1)))
  ```
</CodeGroup>

The installer drops the binary in `~/.cyberun/bin` on Linux and
macOS, and `~/.cyberun\bin` on Windows — no `sudo` needed. Override
with `--install-dir`; a root-owned target like `/usr/local/bin`
triggers `sudo` only for the final move:

```bash theme={null}
curl -sL https://releases.cyberun.cloud/cli/install.sh | bash -s -- --install-dir /usr/local/bin
```

Prefer to grab the binary directly? Builds are published per platform
under `releases.cyberun.cloud/cli/<os>-<arch>/latest/`, with a single
shared `cli/checksums.txt`, for Linux, macOS, and Windows on `amd64`
and `arm64`.

Verify the install:

```bash theme={null}
cyberun --version
```

## Sign in

A fresh install has no API host configured yet, so point the CLI at
the Cloud API first — either with an environment variable or the
`--api-host` flag:

```bash theme={null}
export CYBERUN_API_URL=https://core.cyberun.cloud
```

Then sign in:

```bash theme={null}
cyberun auth login
```

`auth login` saves the host for you, so you only set it once. (Pass
`--api-host https://core.cyberun.cloud` on the command instead if you
prefer not to set the variable.)

This pairs your machine with a team. The CLI prints a short code and opens your browser to
confirm it while you're signed in to
[app.cyberun.cloud](https://app.cyberun.cloud); approve it there and
the CLI stores the credentials locally. Pairing issues a device
credential (`dk-`) for API calls **and** a companion agent credential
(`ak-`) — the same companion agent described in
[Credentials](/cloud/concepts/credentials), which lets the machine
serve workflows.

Check or end the session:

```bash theme={null}
cyberun auth status   # profile, API host, signed-in user
cyberun auth logout   # revoke the device credential, then clear local state
```

`cyberun auth logout` revokes the device credential server-side —
which also revokes its companion agent — and then removes the stored
credentials from this machine.

## Run a workflow

The quickest path submits a workflow and waits for the result in one
command:

```bash theme={null}
cyberun run --slug my-workflow --params '{"prompt": "a red bicycle"}'
```

`run` accepts either `--slug` or `--id`, takes parameters as a JSON
object via `--params`, prints the finished task as JSON, and exits
non-zero if the task fails or is cancelled. Add `--download` to fetch
the result file when the task completes (defaults to
`<task-id>.bin`, or pass `--output <path>`), and `--poll-interval`
to change how often it checks (default `3s`):

```bash theme={null}
cyberun run --slug my-workflow \
  --params '{"prompt": "a red bicycle"}' \
  --download --output bike.png
```

To submit without waiting, use `workflow run` instead — it returns
the task id immediately:

```bash theme={null}
cyberun workflow run --slug my-workflow --params '{}'
```

## Inspect workflows and tasks

```bash theme={null}
cyberun workflow list                 # runtime workflows for the team
cyberun workflow get --slug my-workflow
cyberun workflow get --id <workflow-id>
```

`workflow` is also available as `wf` or `workflows`.

```bash theme={null}
cyberun task list                     # recent tasks
cyberun task get --id <task-id>       # status and metadata
cyberun task cancel --id <task-id>
cyberun task download --id <task-id> --output result.png
```

`task` is also available as `tasks`. `download` writes to
`<task-id>.bin` if you omit `--output`, and only works once the task
has completed.

## Run a local agent

If the machine you're signed in on has a GPU to share, turn it into
an agent for the team:

```bash theme={null}
cyberun agent serve --tool comfyui
```

This connects using the companion agent credential stored at login
and streams tasks until you stop it (`Ctrl-C`). The gateway endpoint
is derived from your API host; override it with `--gateway-url` if
needed. List the team's connected agents with `cyberun agent list`.

`agent serve` is a foreground worker tied to your logged-in session —
handy for ad-hoc sharing from a machine you're already using. For a
**dedicated or headless GPU host** you want a managed, always-on
service instead: use the standalone agent installer described in
[Connect an agent](/cloud/guides/connect-agent).

## Configuration

The CLI keeps its state in `~/.cyberun/cyberun` (or
`$XDG_CONFIG_HOME/cyberun` when that's set) — `cyberun auth login` writes it for you,
so there's normally nothing to edit by hand.

Use **profiles** to keep more than one account or team on the same
machine. Every command takes `--profile <name>`; `auth login` creates
the profile if it doesn't exist.

Point the CLI at a different API host or gateway without editing
anything — pass a flag for a single command, or set an environment
variable for the session:

| Setting     | Flag                               | Environment variable  |
| ----------- | ---------------------------------- | --------------------- |
| API host    | `--api-host`                       | `CYBERUN_API_URL`     |
| Gateway URL | `--gateway-url` (on `agent serve`) | `CYBERUN_GATEWAY_URL` |
| Profile     | `--profile`                        | —                     |

## Related

* [Credentials](/cloud/concepts/credentials) — the `dk-` and `ak-`
  the CLI stores at login.
* [Connect an agent](/cloud/guides/connect-agent) — the standalone
  installer for dedicated GPU hosts.
* [Run your first task](/cloud/getting-started/first-task) — the same
  thing from the dashboard.
* [API reference](/api-reference/introduction) — the HTTP API the CLI
  calls.
