# Getting started

Five steps from nothing to a job's logs on your screen. Everything here also
works in the [web app](https://rrun.041.io/docs/web-app.md) at `/app`.

## 1. Install

```bash
curl -fsSL https://rrun.041.io/install.sh | sh
```

The script puts `o41-rrun` in `~/.local/bin` (set `O41_RRUN_INSTALL_DIR` to
choose another directory) after checking the download against the release's
SHA-256. It runs on Linux and macOS, x64 and arm64. Later, `o41-rrun update`
moves to the newest release.

## 2. Sign in

```bash
o41-rrun login
```

It prints a link and a code; open the link on any device, so it works over SSH
too. The sign-in is saved in `~/.config/o41-rrun/auth.json` and refreshed as
needed.

Everything in rrun belongs to an organization. With one organization, `login`
picks it. With several, pick one:

```bash
o41-rrun org              # your organizations; * marks the current one
o41-rrun org use my-lab   # by id, slug or name
```

With none, create one in the web app, then run `o41-rrun login` again.

## 3. Connect a cloud

rrun launches machines in your own cloud accounts, so it needs at least one.
`clouds set` reads credentials from the usual environment variables and files:

```bash
o41-rrun clouds set vast     # VAST_API_KEY or ~/.config/vastai/vast_api_key
o41-rrun clouds set runpod   # RUNPOD_API_KEY or ~/.runpod/config.toml
o41-rrun clouds set verda    # VERDA_CLIENT_ID/_SECRET or ~/.verda/config.json
```

Google Cloud connects without a key; [Clouds](https://rrun.041.io/docs/clouds.md#google-cloud) has the
`gcloud` commands. rrun checks the credentials with the provider before it
stores them.

## 4. See what it would cost

```bash
o41-rrun offers --gpu RTX5090,RTX5080,A6000 --ram 64 --spot
```

This prints the matching offers on every connected cloud, cheapest first. It
launches nothing.

## 5. Run

From the folder you want to run:

```bash
o41-rrun run --gpu RTX5090,RTX5080,A6000 --ram 64 --spot -f -- ./train.sh
```

rrun packs the folder, uploads it, takes the cheapest offer that fits, runs
`./train.sh` there and streams its output. `-f` exits with the job's exit code.
Ctrl-C stops following; the job keeps running.

`--gpu` (any one of the listed models will do) or `--cpu-only` is required.
Everything after `--` is the command.

## Then

```bash
o41-rrun ls                     # jobs, newest first
o41-rrun status j-4k2m9x7qpz    # spec, machine, events, telemetry
o41-rrun logs j-4k2m9x7qpz -f   # follow again
o41-rrun cancel j-4k2m9x7qpz
o41-rrun machines               # what is running or idle, and until when
```

After the job, the machine idles for five minutes in case the next job fits,
then it is deleted. Next: [Jobs and logs](https://rrun.041.io/docs/jobs-and-logs.md), or
[API keys and agents](https://rrun.041.io/docs/api-keys-and-agents.md) to hand rrun to an agent.

---

rrun by 041 documentation. Every page: https://rrun.041.io/llms.txt
