atmos completion
Use this command to generate completion scripts for Bash
, Zsh
, Fish
and PowerShell
.
Usageβ
Execute the completion
command like this:
atmos completion [bash|zsh|fish|powershell]
This command generates completion scripts for Bash
, Zsh
, Fish
and powershell
.
When the generated completion script is loaded into the shell, pressing the tab key twice displays the available commands and the help.
Run atmos completion --help
to see all the available options
Configuring Your Shellβ
To enable command completion, you need to configure your shell. The setup process depends on which shell youβre using (e.g., zsh
or bash
).
Select your shell below for detailed setup instructions.
- Bash
- zsh
Bash Completion Setupβ
To enable tab completion for Atmos in Bash, add the following to your ~/.bashrc
or ~/.bash_profile
:
# Enable Atmos CLI completion
source <(atmos completion bash)
After saving the file, apply the changes by running:
source ~/.bashrc
Now, you can run any atmos
command, and pressing <Tab>
after typing atmos
will show the available subcommands. The same applies to --stack
arguments and commands requiring a component (e.g., atmos terraform plan
).
Zsh Completion Setupβ
To enable tab completion for Atmos in Zsh
, add the following to your ~/.zshrc
:
# Initialize Zsh completion system
autoload -Uz compinit && compinit
# Enable Atmos CLI completion
source <(atmos completion zsh)
# Improve completion behavior
zstyle ':completion:*' menu select # Enable menu selection
zstyle ':completion:*' force-list always # Force vertical menu listing
# Ensure the Tab key triggers autocompletion
bindkey '\t' expand-or-complete
After saving the file, apply the changes by running:
source ~/.zshrc
Now, you can run any atmos
command, and pressing <Tab>
after typing atmos
will show the available subcommands. The same applies to --stack
arguments and commands requiring a component (e.g., atmos terraform plan
).
If completions do not work, try regenerating the completion cache:
rm -f ~/.zcompdump && compinit
The Atmos completion script statically completes custom commands based on the Atmos configuration. If completions are generated without this configuration (e.g., outside a project directory), custom commands wonβt be included. To ensure accuracy, generate or regenerate the script from the correct working directory. This only affects custom commands. Components, stacks, and built-in commands remain fully dynamic.
Examplesβ
atmos completion bash
atmos completion zsh
atmos completion fish
atmos completion powershell
You can generate and load the shell completion script for Bash
by executing the following commands:
atmos completion bash > /tmp/completion
source /tmp/completion
or
source <(atmos completion bash)
Argumentsβ
Argument | Description | Required |
---|---|---|
shell_name | Shell name. Valid values are bash , zsh , fish and powershell | yes |
Refer to Command-line completion for more details