# ry computer

> Links to watch or control a computer VM (images/computer), and who had control.

```text
ry computer [options] [command]
```

## Subcommands

### `ry computer create`

Create a computer: an app on the computer image with its own home disk (what the console's New computer does).

```text
ry computer create [options] <name>
```

Options:

- `-s, --size <size>`: small | base | large - the machine and the home disk (default: base).
- `-i, --image <ref>`: The computer image: an OCI reference, or a `build:<id>` of your team (default: $RYTIV_COMPUTER_IMAGE).

Example:

```bash
ry computer create dev-1 --image rytiv/computer:0.1.0
ry computer create dev-2 --size large --image rytiv/computer:0.1.0
```

### `ry computer view`

A link to watch the desktop (view only, any number of viewers).

```text
ry computer view [options] <app>
```

Options:

- `--ttl <seconds>`: How long the link opens a connection (60 to 3600, default 900).
- `--who <name>`: Who the link is for (audit; default: you).
- `-m, --machine <id>`: Which machine (default: the app's one machine).

Example:

```bash
ry computer view dev-1
```

### `ry computer control`

A link to take control (keyboard and mouse); one holder per machine, the agent in the VM pauses.

```text
ry computer control [options] <app>
```

Options:

- `--ttl <seconds>`: How long the control lease lasts (60 to 3600, default 900).
- `--who <name>`: Who takes control (audit, shown to the agent; default: you).
- `--force`: Take control from the current holder (their connection ends).
- `-m, --machine <id>`: Which machine (default: the app's one machine).

Example:

```bash
ry computer control dev-1 --ttl 1800
```

### `ry computer release`

End the control lease (the connection ends, the agent in the VM may continue).

```text
ry computer release [options] <app>
```

Options:

- `-m, --machine <id>`: Which machine (default: the app's one machine).

Example:

```bash
ry computer release dev-1
```

### `ry computer audit`

Who got which link, from when to when, and how control ended (all machines the app had).

```text
ry computer audit [options] <app>
```

Options:

- `-m, --machine <id>`: Only this machine.
- `--mode <mode>`: View, control or all (default all).
- `--limit <n>`: How many rows (default 50, at most 200).

Example:

```bash
ry computer audit dev-1
```

### `ry computer init`

Generate the link signing key (COMPUTER_VIEW_KEY) and store it as an app secret - never printed.

```text
ry computer init [options] <app>
```

Options:

- `--now`: Apply right away: rolling restart, and this command waits for it.
- `--rotate`: Replace an existing key (every link issued so far stops working after the restart).

Example:

```bash
ry computer init dev-1
```
