> ## 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

> Log in to Qovery from a browser or a headless session, check your login status and print the access token

## 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. Every command then uses the token directly, so you do not need to run `qovery auth`, which always starts the browser or headless login flow:

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

> [!NOTE]
>
> You can generate an API token from the Qovery Console under **Settings** → **API Tokens**.

### 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]
```

**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
```

## 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 }}"
# No `qovery auth` needed: the CLI uses QOVERY_CLI_ACCESS_TOKEN directly
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
```

## Command reference

Generated from `qovery auth --help` (CLI v1.180.0). Every command also accepts `-h, --help` and the [global flags](https://www.qovery.com/docs/cli/commands/overview.md#global-flags).

### `qovery auth`

Log in to Qovery

```text Usage theme={null}
qovery auth [flags]
qovery auth [command]
```

| Subcommand | Description |
| - | - |
| `qovery auth status` | Show authentication status without exposing the access token |
| `qovery auth token` | Output the current valid access token |

| Flag | Short | Type | Default | Required | Description |
| - | - | - | - | - | - |
| `--headless` | | bool | | | Headless auth |
| `--skipVersionCheck` | | bool | | | Skip CLI version check during authentication |

### `qovery auth status`

Show authentication status without exposing the access token

```text Description from qovery auth status --help theme={null}
Show whether the CLI is currently authenticated, as whom, which organization
is selected, and when the session expires.

This command never prints the access token or any other secret value, regardless
of flags. Use it as the safe way to check authentication from scripts, CI, and
automation, instead of parsing the output of 'qovery auth token':

  qovery auth status >/dev/null 2>&1 && echo authenticated || echo "not authenticated"

Unlike most other commands, this always makes a live call to the Qovery API to
confirm the token is currently accepted — a token that is present and well-formed
but has been revoked or expired server-side is reported as not authenticated,
whether it came from a browser login or from QOVERY_CLI_ACCESS_TOKEN / Q_CLI_ACCESS_TOKEN.

Exit code is 0 when authenticated, 1 otherwise.
```

```text Usage theme={null}
qovery auth status [flags]
```

| Flag | Short | Type | Default | Required | Description |
| - | - | - | - | - | - |
| `--json` | | bool | | | JSON output |

### `qovery auth token`

Output the current valid access token

```text Description from qovery auth token --help theme={null}
Output the current valid access token (refreshing it if expired).

This command provides a valid access token that can be used to make direct API calls 
to the Qovery API. The token is automatically refreshed if it has expired.

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

If you only need to check whether the CLI is authenticated (e.g. from a script
or an automated agent), use 'qovery auth status' instead — it never prints the
token, even with --json.
```

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

| Flag | Short | Type | Default | Required | Description |
| - | - | - | - | - | - |
| `--authorization-header` | | bool | | | Output the full Authorization header value (e.g. 'Bearer eyJ...') |
| `--json` | | bool | | | Output as JSON with token, type, expiration, and API URL |
| `--print` | | bool | | | Print the raw access token value to stdout |

Examples printed by `qovery auth token --help`, verbatim.

```text qovery auth token --help 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 with token, type, expiration, and API URL
qovery auth token --json

# Get JSON with the authorization header pre-formatted
qovery auth token --json --authorization-header
```

## Related Commands

* [`qovery api`](https://www.qovery.com/docs/cli/commands/api) - Make authenticated HTTP requests to the Qovery API
* [`qovery context`](https://www.qovery.com/docs/cli/commands/context) - Manage CLI context


## Related topics

- [qovery api](https://www.qovery.com/docs/cli/commands/api.md)
- [Qovery CLI](https://www.qovery.com/docs/cli/overview.md)
- [qovery context](https://www.qovery.com/docs/cli/commands/context.md)
- [qovery demo](https://www.qovery.com/docs/cli/commands/demo.md)
- [qovery token](https://www.qovery.com/docs/cli/commands/token.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.