# openrail login

> Log the CLI in to an openrail console and store an API token.

Log the CLI in to an openrail console and store an API token.

## Usage

```sh
openrail login [URL]
```

## Flags

| Flag | Meaning |
|---|---|
| `--token TOKEN` | Store this API token instead of opening the browser (for servers and CI) |
| `--browserless` | Print the login link and code instead of opening a browser |

## Details

- Without `--token`, the CLI starts a device login: it opens `URL` in your browser, you approve the code shown in the terminal, and the CLI stores the token it receives.
- Tokens live in `~/.config/5050/config.json` (mode 0600), one per console URL, so you can log in to several installs.
- In CI, skip login and set `OPENRAIL_URL` and `OPENRAIL_TOKEN` instead.

## Examples

```sh
openrail login https://console.example.com
openrail login https://console.example.com --token 5050_xxxxxxxx
```

## Railway equivalent

`railway login` works the same way through the [railway alias](https://openrail.app/docs/cli/railway-alias).

Every command also accepts the [global options](https://openrail.app/docs/cli/global-options).
