Before you can automate actions on Astro, you must prove to Astro that your automation tool has the correct identity and access to interact with specific Astro resources. Complete the following actions to authenticate to Astro using the Astro CLI and API tokens:Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Create an API token in Astro.
- Install the Astro CLI in your automation environment, such as a GitHub Actions.
- Make the token accessible to the Astro CLI installed in your automation environment.
Step 1: Create an API token
You can use any of the following credentials to authenticate in an automated process:- A Deployment API token. See Deployment API tokens.
- A Workspace API token. See Create a Workspace API token.
- An Organization API token. See Create an Organization API token.
- Always give your API token the minimum permissions required to perform an action. This improves control and security over your Astro components. For example, instead of creating an Organization API token to automate actions across two Workspaces, create a separate Workspace API token for each Workspace.
- Always set an expiration date for your API tokens.
- Always rotate your API tokens for enhanced security.
Step 2: Install the Astro CLI in your automation tool
To manage your Astro workflows programmatically, you must install the Astro CLI in the environment which will run the workflows. Typically, this requires runningcurl -sSL install.astronomer.io | sudo bash -s or an equivalent installation command before your process starts. See CI/CD templates for examples of how to install the Astro CLI in different version management and workflow automation environments.