amp completion command allows you to add shell completion to your AMP CLI.
$ amp completion --help Usage: amp completion SHELL [flags] Output shell completion code for the specified shell (bash or zsh) Examples: # Install bash completion on a Mac using homebrew $ brew install bash-completion Once installed, bash_completion must be evaluated. This can be done by adding the following line to the .bash_profile, and reloading it source $(brew --prefix)/etc/bash_completion $ source $HOME/.bash_profile # Write bash completion code to a file $ amp completion bash > ~/.config/amp/completion.bash.inc Add this line in your $HOME/.bash_profile, and reload it source "$HOME/.config/amp/completion.bash.inc" $ source $HOME/.bash_profile # Load the amp completion code for zsh into the current shell source <(amp completion zsh) Options: -h, --help Print usage -k, --insecure Control whether amp verifies the server's certificate chain and host name -s, --server string Specify server (host:port)
--helpoption for any of the AMP commands or sub-commands to more information about the command's usage.
In order to use shell completion with AMP, follow the installation instructions for your corresponding shell.
Make sure bash completion is installed:
- Most current Linux OS (non-minimal installations) have bash completion.
- On Mac, install with
brew install bash-completion
After bash completion is installed, add the following line to your
source $(brew --prefix)/etc/bash_completion
Then, either source your
~/.bash_profile or launch a new terminal.
Now you need to write the bash completion, generated by AMP, to a file. We recommend writing
it to a file in your
$ amp completion bash > ~/.config/amp/completion.bash.inc
After doing this, add the following line to your
~/.bash_profile file to source your bash completion file.
Then either source your
~/.bash_profile or launch a new terminal again.
In a Zsh shell, load the amp completion code with:
$ source <(amp completion zsh)
source <(amp completion zsh) to your
With the shell completion code loaded for AMP, you can hit tab twice to view the shell completion.
$ amp cluster completion config login logout logs password service stack stats team user version whoami
$ amp stack deploy logs ls rm services
$ amp stack deploy -c examples/stacks/pinger/ README.md pinger.yml