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

# auth, doctor, and env

> Authenticate the CLI, inspect the active environment, and verify staging or production connectivity.

# auth, doctor, and env

Use these commands first on a fresh machine or when switching between production and the private beta.

## auth

```bash theme={null}
lim auth login
lim auth whoami
lim auth logout
```

For staging validation with the private package:

```bash theme={null}
lim-beta auth login
lim-beta auth whoami
```

`auth login` opens the browser, completes WorkOS sign-in, and stores a local CLI token.

## doctor

```bash theme={null}
lim doctor
lim-beta doctor
```

`doctor` prints:

* effective API URL
* effective web URL
* active channel
* `healthz` reachability
* local Node.js version

Use it before filing issues. It is the fastest way to verify whether a problem is local config, auth, or API reachability.

## env

```bash theme={null}
lim env
lim-beta env
```

`env` shows both the config-file values and the effective values after environment-variable overrides.

## Common staging workflow

```bash theme={null}
lim-beta doctor
lim-beta env
lim-beta auth login
lim-beta auth whoami
```

## Environment variables

| Variable      | Purpose                      |
| ------------- | ---------------------------- |
| `LIM_API_URL` | Override the API origin      |
| `LIM_WEB_URL` | Override the web origin      |
| `LIM_CHANNEL` | Force `beta` or `production` |

<Tip>
  If a command returns `401`, check `lim-beta auth whoami` first. If it returns a user, then the next
  thing to verify is the active company.
</Tip>
