> ## Documentation Index
> Fetch the complete documentation index at: https://astronomer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# astro completion

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

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.

<Info>
  If you're running the CLI MacOS, install [Bash Completion](https://github.com/scop/bash-completion) before creating autocompletion scripts. To do this with Homebrew, run:

  ```sh wrap theme={null}
   brew install bash-completion
  ```
</Info>

## Usage

```sh wrap theme={null}
astro completion <shell>
```

## Options

| Option    | Description                                          | Possible Values                   |
| --------- | ---------------------------------------------------- | --------------------------------- |
| `<shell>` | The type of shell to generate completion scripts for | `bash`,`fish`, `powershell`,`zsh` |

## Example

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

```sh wrap theme={null}
$ 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:

```sh wrap theme={null}
autoload -U compinit
compinit -i
```
