NOTE: This information applies to using Vault on the Linux OS, or to using the Windows Subsystem for Linux (WSL) on the Windows OS. The completion feature for Vault and the following instructions are not supported for other shells, such as the Command Shell or PowerShell interpreters on Windows.
If you followed the instructions for installing Vault, then you added the
vault binary path to your system PATH so that it can be executed as just
vault (i.e. without a path prefix). If you did not follow the instructions for installing Vault, review the link and be sure you have Vault properly installed.
vault binary includes command-line completion for subcommands, flags, and path arguments where supported for the Bash, Fish, or ZSH shell.
Other shells are not currently supported and you will encounter an error when attempting to use an unsupported shell:
Error executing CLI: Did not find any shells to install
vault command to install command-line completions like this.
$ vault -autocomplete-install
The command is expected to return no output upon successful execution.
This installs the helpers in your shell configuration file depending on the type of shell you use:
Once you have installed the completions, you should restart your terminal session or reload the shell to begin using them.
$ exec $SHELL
Now when you type
vault followed by pressing tab, Vault suggests command options:
agent auth delete lease login operator plugin print secrets ssh token write audit debug kv list namespace path-help policy read server status unwrap
This extends into sub-commands as well; for example, here is what typing
vault operator followed by pressing tab suggests as sub-commands:
generate-root key-status raft rotate step-down init migrate rekey seal unseal
These completions are helpful for beginners to discover commands and also handy for advanced Vault users who frequently need to quickly and accurately execute more complex commands.
If you visited this page from the Install Vault section of the Getting Started guide, then your installation of Vault is complete. Please proceed to Starting the Server to continue getting started with Vault.