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

# modus login

> Authenticate the CLI via OAuth (default, browser-based) or a personal access token (PAT).

Authenticate the CLI via OAuth (default, browser-based) or a personal access token (PAT).

## Usage

```bash theme={null}
modus login [flags]
```

## Flags

| Flag         | Type    | Description                                                                                                                                                                                                                                 |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--token`    | string  | Personal access token — implies --no-oauth. Prompted (hidden input) if you pass --no-oauth without --token; prefer that, or MODUS\_API\_KEY, over this flag: a token on the command line is readable from shell history, `ps`, and CI logs. |
| `--oauth`    | boolean | Authenticate via OAuth (browser-based). This is the default; pass --no-oauth (or --token) for the PAT flow instead — e.g. in a headless environment with no browser.                                                                        |
| `--issuer`   | string  | OAuth authorization server origin. Only needed for non-standard deployments (local dev) — defaults to the api.*→app.* counterpart of --base-url (e.g. api.staging.getmodus.com → app.staging.getmodus.com).                                 |
| `--base-url` | string  | Override the API origin (e.g. for staging). Persisted alongside the token.                                                                                                                                                                  |

Global: `--pretty` — human-readable table output instead of compact JSON.

## Examples

```bash theme={null}
modus login
modus login --no-oauth
modus login --token modus_pat_<orgUuid>_<prefix>_<secret>
```

See [CLI quickstart](/guides/cli) for install and auth.
