# Device login

> Sign the CLI in on a machine without a browser, or from CI with an existing key.

Source: https://nodus-platform-site.pages.dev/docs/guides/access/device-login/
Build revision: 211ad9f836655b1c3a2668c4693e442471f28614

On a remote server or container with no browser:

Terminal window

```bash
nodus login --device
```

The CLI prints a code like `BDWP-HMTR` and a link. Open the link on any device where you are signed in, check that the code matches, pick the orgs and approve. The CLI finishes on its own within a few seconds. The code works for 10 minutes; denying it stops the login.

The CLI polls every 5 seconds. Every key it receives is the same kind `nodus login` creates: one per chosen org, 90 days, revocable with `nodus logout` or `nodus delete apikey`.

## In CI

Pass an existing key instead of signing in:

Terminal window

```bash
echo "$NODUS_API_KEY" | nodus login --with-token
```

Prefer a [service account token](https://nodus-platform-site.pages.dev/docs/guides/access/service-accounts/) for CI, so it keeps working when people leave.
