Skip to main content

astro completion


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

Generate completion scripts for Astro CLI commands. You can modify the generated scripts and add them to the appropriate directory to customize your command line autocompletion behavior.

For example, you could set automation such that typing astro lo autocompletes to astro login if you press TAB on your keyboard and astro login or astro logout if you press TAB again.

This command is helpful for users interacting with the CLI on a regular basis.


If you're running the CLI MacOS, install Bash Completion before creating autocompletion scripts. To do this with Homebrew, run:

 brew install bash-completion


astro completion <shell>


OptionDescriptionPossible Values
<shell>The type of shell to generate completion scripts forbash,fish, powershell,zsh


To generate a shell completion script for zsh, for example, you can run:

$ astro completion zsh > /usr/local/share/zsh/site-functions/_astro
# Completion script saved in your local directory

Then, to enable autocompletion, ensure that the following lines are present in your ~/.zshrc file:

autoload -U compinit
compinit -i

Was this page helpful?

Sign up for Developer Updates

Get a summary of new Astro features once a month.

You can unsubscribe at any time.
By proceeding you agree to our Privacy Policy, our Website Terms and to receive emails from Astronomer.