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

# astro auth token

<Info>The behavior and format of this command are the same for both Astro and Astro Private Cloud.</Info>

Print the current authentication token to standard output. The output contains only the raw token value with the `Bearer` prefix stripped, making it suitable for use in scripts and CI/CD pipelines. The command returns an error if you are not authenticated.

## Usage

```sh wrap theme={null}
astro auth token
```

## Options

| Option           | Description                                                                                                                                            | Possible Values         |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
| `-d`, `--domain` | Print the token for a specific context domain instead of the current context. Useful for Astro Private Cloud environments with multiple control planes | Any valid domain string |

## Examples

```sh wrap theme={null}
astro auth token
# Print the authentication token for the current context

astro auth token --domain cloud.astronomer.io
# Print the token for a specific context domain

# Use in scripts
export ASTRO_TOKEN=$(astro auth token)
curl -H "Authorization: Bearer $ASTRO_TOKEN" https://api.astronomer.io/...
```

## Related commands

* [`astro auth login`](/docs/cli/v1.41/astro-auth-login)
* [`astro auth logout`](/docs/cli/v1.41/astro-auth-logout)
