astro auth token

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

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

1astro auth token

Options

OptionDescriptionPossible Values
-d, --domainPrint the token for a specific context domain instead of the current context. Useful for Astro Private Cloud environments with multiple control planesAny valid domain string

Examples

1astro auth token
2# Print the authentication token for the current context
3
4astro auth token --domain cloud.astronomer.io
5# Print the token for a specific context domain
6
7# Use in scripts
8export ASTRO_TOKEN=$(astro auth token)
9curl -H "Authorization: Bearer $ASTRO_TOKEN" https://api.astronomer.io/...