> ## Documentation Index
> Fetch the complete documentation index at: https://docs.masterskills.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# masterskills login

> Authorize this device with one browser round-trip.

```bash theme={"dark"}
masterskills login
```

Runs the device-authorization flow described in [Devices & authentication](/concepts/devices):

1. The CLI requests a device code and prints a short confirmation code:

   ```text theme={"dark"}
     Confirm this code in your browser:

         XXXX-XXXX

     https://masterskills.dev/device?code=XXXX-XXXX

     Waiting for approval…
   ```

2. The browser opens automatically. Sign in with GitHub or Google, confirm the code matches, and pick the organization this device belongs to (its **home org** — the default publish namespace). Users with no organization create one right there.

3. The CLI receives a **lifetime device token**, stores it in `~/.masterskills/config.json`, and confirms:

   ```text theme={"dark"}
   ✓ Logged in as dev@acme.com
   ✓ Organization: @acme
   ✓ This device is authorized — you won't need to log in again here.
   ```

## Options

| Option            | Effect                                                               |
| ----------------- | -------------------------------------------------------------------- |
| `--api-url <url>` | Target a self-hosted or dev server; persisted for all later commands |
| `--no-open`       | Print the verification URL without opening a browser                 |

## Failure modes

| Message                               | Meaning                                                                                         |
| ------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `Login expired or was denied`         | The code lapsed or you declined in the browser — run `login` again                              |
| `Login timed out`                     | The approval never arrived within the code's lifetime — run `login` again                       |
| `device_limit` (shown in the browser) | Free plan allows 1 device per user — revoke the old device in the [panel](/panel/devices) first |

The device appears in the panel immediately and can be revoked there at any time; a revoked device simply gets a 401 and is told to `masterskills login` again.
