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

# basecut login

> Authenticate with your Basecut account

Authenticate the CLI with your Basecut account using the OAuth2 device authorization flow. This will open a browser window for you to sign in. Once complete, your credentials are saved to a local profile.

<Info>
  `basecut login` requires an interactive terminal to open the browser and poll
  for the authentication token.
</Info>

## Usage

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

## Flags

### Optional

| Flag               | Default   | Description                                              |
| ------------------ | --------- | -------------------------------------------------------- |
| `--profile <name>` | `default` | The name of the local profile to save credentials under. |

***

## Examples

### Quick Start

```bash theme={null}
# Standard interactive login
basecut login

# Login and save to a specific profile
basecut login --profile production
```

***

### Standard Interactive Login

Most common usage to get started:

```bash theme={null}
basecut login
```

**What happens:**

1. The CLI generates a unique device code.
2. It attempts to open your default web browser to the Basecut login page.
3. You sign in via the browser.
4. The CLI polls the API until the authorization is confirmed.
5. Success credentials are stored in `~/.basecut/credentials`.

***

### Machine-to-Machine / Headless Login

For environments without a browser (like SSH sessions), Basecut will print a URL for you to copy-paste:

```bash theme={null}
basecut login
```

If a browser can't be opened, you'll see:

```bash theme={null}
Please visit: https://basecut.dev/auth/device
And enter code: ABCD-1234
```

***

## Environment Variables

| Variable             | Description                                                         |
| -------------------- | ------------------------------------------------------------------- |
| `BASECUT_NO_BROWSER` | Set to `true` to skip attempting to open the browser automatically. |

***

## Success Output

```bash theme={null}
✓ Authenticating...
✓ Browser opened to https://basecut.dev/auth/device
✓ Authenticated as jake@example.com
✓ Credentials saved to profile: default
```

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Check Status" icon="user" href="/cli-reference/whoami">
    Verify your current login status and plan
  </Card>

  <Card title="Log Out" icon="right-from-bracket" href="/cli-reference/logout">
    Remove stored credentials
  </Card>
</CardGroup>
