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

# linkapp login

> Authenticate with Linktree

## Usage

```bash theme={"system"}
npx @linktr.ee/linkapp login [options]
```

Log in with a browser-based device flow. The CLI stores a token locally for the chosen environment.

## Options

| Flag         | Description                                       | Default |
| ------------ | ------------------------------------------------- | ------- |
| `--qa`       | Login to the QA environment instead of production | `false` |
| `-h, --help` | Show help                                         | -       |

## Flow

1. Checks if you're already logged in and asks whether to re-authenticate.
2. Starts the device authorization flow and shows a short code and URL.
3. Opens your browser so you can approve access (follow the URL if the browser doesn't open).
4. Polls until authorization completes, validates the token, and saves it locally with its expiry.

## Examples

```bash theme={"system"}
npx @linktr.ee/linkapp login        # Production
npx @linktr.ee/linkapp login --qa   # QA
```

If you need to capture the exact expiry, the CLI prints it after a successful login.
