The Astro CLI is a command-line interface for data orchestration. It allows you to get started with Apache Airflow quickly and it can be used with all Astronomer products.
astro [command]
loginLog in to the Astro CLIlogoutLog out of the Astro CLIdev initInitialize an Astro project in an empty local directorydev startBuild your Astro project into a Docker image and spin up a local Docker container for each Airflow componentdev stopPause all Docker containers running your local Airflow environmentdev restartStop your Airflow environment, rebuild your Astro project into a Docker image, and restart your Airflow environment with the new Docker imagedeployDeploy code to a Deployment on AstrodeploymentManage your Deployments running on AstronomerdevRun your Astro project locallyhelpHelp about any Astro CLI commandversionShow the running version of the Astro CLIworkspaceManage Astronomer Workspaces
For a list of available Astro CLI commands, see the Astro CLI command reference.
Use these instructions to install, upgrade, or uninstall the Astro CLI.
To install the Astro CLI on Mac, you'll need:
- Homebrew
- Docker Desktop (v18.09 or higher)
To install the Astro CLI on Windows, you'll need:
- Windows 10 or later
- Docker Desktop for Windows
- Docker Engine 1.13.1 or later
- WSL enabled on your local machine
To install the Astro CLI on Windows with the Windows Package Manager winget command-line tool, you'll need:
- Windows 10 1709 (build 16299) or later or Windows 11
- Astro CLI version 1.6 or later
- The latest version of the Windows App Installer
- Docker Desktop for Windows
- Docker Engine 1.13.1 or later
- WSL enabled on your local machine
To install the Astro CLI on Linux, you'll need:
brew install astro-
Go to the Releases page of the Astro CLI GitHub repository, scroll to a CLI version, and then download the
.exefile that matches the CPU architecture of your machine.For example, to install v1.0.0 of the Astro CLI on a Windows machine with an AMD 64 architecture, download astro_1.0.0-converged_windows_amd64.exe.
-
Rename the file
astro.exe. -
Add the filepath for the directory containing the new
astro.exeas a PATH environment variable. For example, ifastro.exeis stored inC:\Users\username\astro.exe, you addC:\Users\usernameas your PATH environment variable. To learn more about configuring the PATH environment variable, see How do I set or change the PATH system variable?. -
Restart your machine.
Starting with Astro CLI version 1.6, you can use the Windows Package Manager winget command-line tool to install the Astro CLI.
Open Windows PowerShell as an administrator and then run the following command:
winget install -e --id Astronomer.Astrocurl -sSL install.astronomer.io | sudo bash -sTo install a specific version of the Astro CLI, specify the version you want to install at the end of the command:
brew install astro@<major.minor.patch-version>-
Delete the existing
astro.exefile on your machine. -
Go to the Releases page of the Astro CLI GitHub repository, scroll to a CLI version, and then download the
.exefile that matches the CPU architecture of your machine.For example, to install v1.0.0 of the Astro CLI on a Windows machine with an AMD 64 architecture, download astro_1.0.0-converged_windows_amd64.exe.
-
Rename the file
astro.exe. -
Add the filepath for the directory containing the new
astro.exeas a PATH environment variable. For example, ifastro.exeis stored inC:\Users\username\astro.exe, you addC:\Users\usernameas your PATH environment variable. To learn more about configuring the PATH environment variable, see How do I set or change the PATH system variable?. -
Restart your machine.
Starting with Astro CLI version 1.6, you can use the Windows Package Manager winget command-line tool to install a specific version of the Astro CLI.
To install a specific version of the Astro CLI, specify the version you want to install at the end of the command. For example, running the following command in Windows PowerShell as an administrator installs Astro CLI version 1.6:
winget install -e --id Astronomer.Astro -v 1.6.0To install a specific version of the CLI, specify the version number as a flag at the end of the command. For example, to install v1.1.0 of the CLI, you would run:
curl -sSL install.astronomer.io | sudo bash -s -- v1.1.0If you receive a
mkdirerror during installation, download and run the godownloader script locally using:$ cat godownloader.sh | bash -s -- -b /usr/local/bin
If you encounter issues when installing the Astro CLI:
-
Make sure Docker Desktop is installed correctly. See [Install Docker Desktop on Windows]https://docs.docker.com/desktop/install/windows-install/).
-
Make sure the Docker Desktop WSL 2 backend is installed and configured correctly. See Docker Desktop WSL 2 backend.
-
Enable Hyper-V on the Docker and Linux Containers and run the Astro CLI natively. For additional information, see the Docker docs troubleshooting guide.
-
Create a project
$ mkdir hello-astro && cd hello-astro $ astro dev init -
Install the binary and Confirm the install worked:
$ ./astroThis generates a basic project directory:
. ├── dags │ ├── exampledag.py ├── tests │ ├── dags │ ├── test_dag_example.py ├── Dockerfile ├── include ├── packages.txt ├── plugins └── requirements.txtDAGs can go in the
dagsfolder, custom Airflow plugins inplugins, python packages needed can go inrequirements.txt, and OS level packages can go inpackages.txt. -
Run
astro dev startto start a local version of airflow on your machine. This will spin up a few locally running docker containers - one for the airflow scheduler, one for the webserver, and one for postgres. (Runastro dev psto verify).
Astro CLI versions are released regularly and use semantic versioning. Backwards compatibility between versions cannot be guaranteed. Compatibility is only guaranteed between matching minor versions of the platform and the Astro CLI. For example, Astro CLI 0.9.0` is guaranteed to be compatible with houston-api v0.9.x, but not houston-api v0.10.x.
Astronomer ships major, minor, and patch releases of the Astro CLI in the following format:
{MAJOR_RELEASE}.{MINOR_RELEASE}.{PATCH_RELEASE}
All Astro CLI releases prior to 1.0.0 are considered beta.
Change log between each version can be found on the releases page
The Astro CLI includes a debug flag that allows you to view queries and internal logs. To enable it, you can pass --verbosity=debug in your commands, or you can add the following entry to your ~/.astro/config.yaml file:
verbosity: debugAdding this entry to your ~/.astro/config.yaml file turns on debugging for all requests until you change it to info, or you remove it from the file.
To resolve an issue, Astronomer recommends reviewing the Astronomer documentation first.
If you're unable to resolve your issue after reviewing the documentation, you can post a question on the Astronomer web forum or you can contact Astronomer support.
Apache 2.0 with Commons Clause
