# convoy ui

> Open convoyd's Web UI in a browser, at the swarm list or at one swarm's latest run. The token is never put in the URL.

```text
convoy ui [<swarm>] [--print]
```

## What it does

Opens the [Web UI](/docs/runtime/web-ui/) that convoyd serves on its own port.

- `convoy ui` opens `<server>/`, the list of every swarm.
- `convoy ui <swarm>` opens `<server>/s/<swarm>/r/latest`, the graph of the swarm's latest run.

`<server>` is `--server` or `CONVOY_URL`, `http://localhost:7070` by default. Before opening anything, `ui` checks that `GET /` answers with HTML. If convoyd is not running, or was started with `--no-ui`, it says so and exits 1.

The browser is opened with `open` on macOS, `xdg-open` on Linux, and `rundll32` on Windows. If none works, `ui` prints the URL to open by hand and exits 0.

The token is never put in the URL. When convoyd runs with `--token`, the UI asks for the token once and keeps it in the browser.

## Flags

| Flag | Meaning |
| --- | --- |
| `--print` | Print the URL instead of opening it |

## Examples

```console
$ convoy ui edge_chips
opened http://localhost:7070/s/edge_chips/r/latest
```

```console
$ convoy ui --print
http://localhost:7070/
```

## Exit codes

| Code | Cause |
| --- | --- |
| `0` | Opened, printed, or no browser available (the URL is printed) |
| `1` | convoyd is unreachable or does not serve the UI |
| `2` | More than one argument, or a `--server` that is not a URL |

## Related

- [Web UI](/docs/runtime/web-ui/)
- [convoy watch](/docs/cli/watch/)
