Install HCP Vault Secrets CLI
Before you can interact with HCP Vault Secrets using the command-line interface (CLI), the vlt
CLI must be installed and configured.
Once installed, you can choose to authenticate interactively using your HCP Portal credentials, or non-interactively using a HCP service principal.
Prerequisites
- An existing HCP account
- Completed the Create a secret in HCP Vault Secrets tutorial
- Homebrew installed
Install HCP Vault Secrets CLI
The HCP Vault Secrets CLI is available for download from releases.hashicorp.com/vlt as a zip archive and via popular package managers.
MacOS users can use Homebrew to install the CLI. Refer to the Homebrew installation instructions if it is not already installed.
Open a new terminal.
Install the HashiCorp tap.
Install the HCP Vault Secrets CLI.
Verify the installation.
Configure the HCP Vault Secrets CLI
Interactive logins launch a web browser to have you authenticate with your HCP user account through a supported authorization method such as username and password, single sign-on (SSO), or GitHub.
Refer to the HCP Vault Secrets documentation to review HCP roles and permissions.
Log in to HCP Vault Secrets using the interactive login.
A new browser will open, log into your HCP account. Once complete, your browser will display
Login is successful. You may close the browser and return to the command line.
.Return to the terminal session.
Example output:
Before proceeding with the HCP Vault Secrets CLI, it must be configured. Run
vlt init
to configure the CLI.If you are a member of multiple HCP organizations, you will be prompted to select the organization you wish to use. Use the arrow keys to select the HCP organization.
Example output:
If you have multiple projects in your HCP organization, you will be prompted to select the project you wish to use. Use the arrow keys to select the HCP project.
Select the
WebApplication
application you created in the previous tutorial.Run
vlt secrets
to review the existing secrets.
Next steps
In this tutorial you installed and configured the HCP Vault Secrets CLI, and authenticated using the interactive and non interactive methods.
In the next tutorial you will learn how to retrieve a secret using the command line interface (CLI) and API which will allow you to automate secret retrieval from HCP Vault Secrets.