Skip to main content

Install the Astro CLI

This is where you'll find information about installing, upgrading, and uninstalling the Astro CLI.

Install the Astro CLI

Install the Astro CLI on a Mac operating system with a single command.

Prerequisites

Installation

To install the latest version of the Astro CLI, run the following command:

brew install astro

If Homebrew doesn't install the latest version of the CLI when you run this command:

  1. Run the following command to update all package definitions (formulae) and Homebrew:

    brew update
  2. Run the following command to install the latest version of the Astro CLI:

    brew install astro
  3. Run the following command to verify the correct Astro CLI version was installed:

    astro version

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

If you specify only a major version, this command installs the latest minor or patch version available for the major version. For a list of all available versions, see the CLI release notes. If you specify only a major version, this command installs the latest minor or patch version available for the major version. For a list of all available versions, see the CLI release notes.

Upgrade the CLI

To upgrade the Astro CLI to the latest version, run the following command:

brew install astro

Uninstall the CLI

To uninstall the Astro CLI on Mac, run:

brew uninstall astro

Migrate from astrocloud to astro

The astrocloud executable is no longer maintained by Astronomer. Complete this migration if all of the following are true:

  • You are an Astro user.
  • You're currently using the astrocloud CLI executable.

For more information about Astro CLI version 1.0.0, see Astro CLI Release Notes.

Step 1: Uninstall astrocloud

To uninstall astrocloud on Mac, run:

brew uninstall astronomer/cloud/astrocloud

Step 2: Install the Astro CLI

Install the latest version of astro on your machine. See Install the CLI.

Step 3: Migrate existing Astro projects

To run and deploy your existing Astro projects using the astro executable, you need to populate these projects with a new .astro directory.

  1. In your terminal, go to the location of your Astro project.

  2. Run astro dev init to generate a new .astro directory in your project. This subdirectory might be hidden in graphical file browsers. You can show hidden files using ⌘ + Shift + . on Mac or by selecting View > Hidden items in Windows file explorer.

    If a prompt appears asking you about whether you want to create a project in a directory that isn't empty, enter Yes. The CLI only creates files that aren't in your directory. In this case, the only files that it creates are ./astro/test_dag_integrity_default.py and .astro/config.yaml.

Step 4: Migrate project configurations (Optional)

If you manually updated the .astrocloud/config.yaml file of an existing Astro project:

  1. In your terminal, go to the location of your Astro project.
  2. Copy the contents from .astrocloud/config.yaml into .astro/config.yaml.
  3. Delete .astrocloud/config.yaml from your project.

Step 5: Update CI/CD pipelines (Optional)

If you have an existing CI/CD pipeline that uses the astrocloud executable, update it to use astro. For example, in a GitHub Actions CI/CD pipeline you would update the following:

# Before:
- name: Deploy to Astro
run: |
brew install astronomer/cloud/astrocloud
astrocloud deploy ${{ secrets.DEPLOYMENT_ID }}

# After:
- name: Deploy to Astro
run: |
curl -sSL install.astronomer.io | sudo bash -s
astro deploy ${{ secrets.DEPLOYMENT_ID }}