astro dev init

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

Initialize an Astro project in an empty local directory. An Astro project contains the set of files necessary to run Airflow, including dedicated folders for your dag files, plugins, and dependencies. An Astro project can be either run locally with astro dev start or pushed to Astronomer with astro deploy.

Usage

1astro dev init <project-name>

Options

OptionDescriptionPossible Values
<project-name>Optional name for your Astro project. Creates and initializes a directory with the specified name.Any string
-a, --airflow-versionVersion of Airflow you want to create an Astro project with. If not specified, latest is assumed. You can change this version in your Dockerfile at any time.String (Airflow version)
-v, --runtime-versionAstro Runtime version to use for project initialization.Any supported Runtime version
-n, --nameName for your Astro project.Any string
--from-templateSpecify a getting started template to use as the base for your Astro project. Opens an interactive menu to select from available templates.N/A (interactive selection)
--remote-execution-enabledEnable Remote Execution mode. Prompts for remote Docker repository, generates client image files and config.N/A
--remote-image-repositoryProvide the remote image repository for client images. If omitted, prompts interactively with a warning if unset.Remote Docker image repository URI

Examples

1$ astro dev init
2# Initializes default project
3
4$ astro dev init my-airflow-project
5# Creates and initializes a directory named 'my-airflow-project'
6
7$ astro dev init --name=MyProject
8# Generates `config.yaml` file with `name=MyProject`
9
10$ astro dev init --airflow-version=2.10.5
11# Initializes project with Airflow 2.10.5
12
13$ astro dev init --airflow-version=3.1.3
14# Initializes project with Airflow 3.1.3
15
16$ astro dev init --runtime-version=13.2.0
17# Initializes project with Runtime 13.2.0
18
19$ astro dev init --runtime-version=3.1-5
20# Initializes project with Runtime 3.1-5
21
22$ astro dev init --from-template
23# Initializes project with an interactive template selection menu

Remote Execution Mode

Enabling remote execution with the --remote-execution-enabled flag results in the following behavior:

  • The CLI prompts you to provide a remote client image repository, unless you specify it with --remote-image-repository.
  • If you do not provide a repository, you receive a warning. You can also configure the remote image repository later via the astro config set remote.client_registry <remote-image-repository> CLI command
  • A new entry in .astro/config.yaml is created or updated with your remote client image repository.
  • These new files are generated for customizing dependencies and build steps for remote execution client images:
    • Dockerfile.client
    • requirements-client.txt
    • packages-client.txt

Examples

1$ astro dev init --remote-execution-enabled
2# Initialize with remote execution and prompt for repo
3
4$ astro dev init --remote-execution-enabled --remote-image-repository=images.astronomer.cloud/baseimages/astro-remote-execution-agent:3.1-4-python-3.12-astro-agent-1.2.1
5# Initialize with remote execution using vanilla Astronomer agent image
6
7$ astro dev init --remote-execution-enabled --remote-image-repository=123456789012.dkr.ecr.us-east-1.amazonaws.com/remote-execution-custom-agent:1.0.0
8# Initialize with remote execution using AWS ECR
9
10$ astro dev init --remote-execution-enabled --remote-image-repository=nexus.company.com:8083/remote-execution-custom-agent:1.0.0
11# Initialize with remote execution using Nexus registry