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

# qovery auth

> Authentication commands for Qovery CLI

## Overview

The `auth` command handles authentication with Qovery. You can authenticate using interactive login or API tokens.

## Commands

### Login

Authenticate with Qovery interactively:

```bash theme={null}
qovery auth
```

This will open your browser to complete the authentication flow.

### Headless Login

For environments without a browser (CI/CD, servers), use headless mode:

```bash theme={null}
qovery auth --headless
```

This will provide a URL that you can open manually to complete authentication.

### Login with API Token

Set your API token as an environment variable:

```bash theme={null}
export QOVERY_CLI_ACCESS_TOKEN="your-api-token"
qovery auth
```

<Info>
  You can generate an API token from the Qovery Console under **Settings** → **API Tokens**.
</Info>

### Token

Output the current valid access token (refreshing it if expired). Useful for making direct API calls to the Qovery API.

For security reasons, the token is not printed by default. You must explicitly use `--print` or `--json` to output the token value.

```bash theme={null}
qovery auth token [flags]
```

**Flags:**

* `--print` — Print the raw access token value to stdout
* `--json` — Output as JSON with token, type, expiration, and API URL
* `--authorization-header` — Output the full Authorization header value (e.g., `Bearer eyJ...`)

**Examples:**

```bash theme={null}
# Print the raw token value
qovery auth token --print

# Use directly in a curl command
curl -H "Authorization: Bearer $(qovery auth token --print)" \
  https://api.qovery.com/organization

# Print the full Authorization header value
qovery auth token --print --authorization-header

# Get structured JSON output
qovery auth token --json
```

### Logout

Clear authentication credentials:

```bash theme={null}
qovery auth logout
```

## Examples

### Interactive Login

```bash theme={null}
qovery auth
# Opens browser for authentication
# Credentials saved locally
```

### Headless Authentication

```bash theme={null}
qovery auth --headless
# Displays URL: https://auth.qovery.com/...
# Copy and paste URL in a browser
# Complete authentication manually
```

### CI/CD Authentication

```bash theme={null}
# In your CI/CD environment
export QOVERY_CLI_ACCESS_TOKEN="${{ secrets.QOVERY_TOKEN }}"
qovery auth
qovery application deploy --application "my-app"
```

### Server/Remote Authentication

```bash theme={null}
# On a remote server without browser
qovery auth --headless
# Copy the displayed URL
# Open URL on your local machine
# Authentication will be saved on the server
```

### Switch Accounts

```bash theme={null}
# Logout from current account
qovery auth logout

# Login with different account
qovery auth
```

## Options

| Flag                 | Description                                                                   |
| -------------------- | ----------------------------------------------------------------------------- |
| `--headless`         | Headless mode for environments without a browser (provides URL to copy/paste) |
| `--skipVersionCheck` | Skip CLI version check during authentication                                  |
| `--help`             | Show help for auth command                                                    |

## Related Commands

* [`qovery api`](/cli/commands/api) - Make authenticated HTTP requests to the Qovery API
* [`qovery context`](/cli/commands/context) - Manage CLI context
