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

# Authentication

> Login, logout, and session management

The CLI authenticates using a Device Authorization flow. Your session credentials are stored locally in `~/.config/lazylocales/`.

## login

Authenticate with your LazyLocales account:

```bash theme={null}
npx lazylocales login
```

<Steps>
  <Step title="Initiate device authorization">
    The CLI generates a device code.
  </Step>

  <Step title="Authorize in browser">
    A browser window opens with a verification URL. If it doesn't open automatically,
    the CLI prints the URL and a one-time code to enter manually.

    ```
    Open this URL in your browser to log in:
      https://auth.com/device?user_code=ABCD-1234
    ```
  </Step>

  <Step title="Session stored">
    Once authorized, the CLI stores your access token, refresh token, and user info
    in `~/.config/lazylocales/`.

    ```
    ✓ Logged in as you@example.com
    ```
  </Step>
</Steps>

## logout

Clear stored credentials:

```bash theme={null}
npx lazylocales logout
```

```
✓ Logged out from you@example.com
  Stored credentials have been cleared.
```

## whoami

Display the currently logged-in user:

```bash theme={null}
npx lazylocales whoami
```

```
Logged in as you@example.com (user_abc123)
```

## Session expiry

Sessions expire automatically. If your session has expired, the CLI will prompt you to log in again when running any command. You can also re-authenticate at any time:

```bash theme={null}
npx lazylocales login
```

## CI/CD environments

In CI/CD pipelines, use an API token instead of interactive login. Set the `LAZYLOCALES_API_KEY` environment variable — the CLI picks it up automatically.

See [CI/CD Setup](/integrations/ci-cd) for a complete guide.
