Commands (CLI)
vlt CLI transitioned to HCP CLI
HCP Vault Secrets CLI workflows are now part of the HCP CLI. We highly recommend migrating to the HCP CLI where new capabilities will continue to be added. See this tutorial to install the HCP CLI and for available commands, refer to the CLI documentation.
vlt CLI will continue to receive critical security fixes until September 27th, 2024.
The below usage information is for the vlt CLI, refer to the links above for using the HCP CLI with HCP Vault Secrets.
Usage
Usage: vlt [--version] [--help] <command> [<args>]
Available commands are:
apps Lists the apps in the project
config Lists or updates the current config
login Login to the Vault Secrets web services
logout Log out of the Vault Secrets web services
run Run a process while injecting secrets as ENV vars
secrets Lists the secrets in an app
version Shows the vlt cli version and golang version
For more information, examples, and usage about a subcommand, click on the name of the subcommand in the sidebar or one of the links below:
Basic command workflow
To start managing your secrets using HCP Vault Secrets CLI, here are the command execution flow.
Run the
login
command to authenticate with your HCP Vault Secrets account.$ vlt login
Initialize and select your target environment with the
config init
command.$ vlt config init Organization with id: 11aa1a11-22b2-33cc-4dd4-5555ee666666 selected Use the arrow keys to navigate: ↓ ↑ → ← ? Multiple Projects found please select the one you would like to configure.: > staging team-devops team-qa ----- Organization ----- Name: staging ID: 11aa1a11-22b2-33cc-4dd4-5555ee666666 Description: This project is used to host staging environments. State: ACTIVE
Use the arrow keys to select your target project.
Create an application using the
apps create
command.$ vlt apps create --description="This app stores the API key for WebApp" webapp Successfully created app with name webapp
Create a secret for the application using the
secrets create
command.$ vlt secrets create --app-name="webapp" apikey="123WEOIN381$%847" Successfully created secret with name apikey
Retrieve the secret value using the
secrets get
command.$ vlt secrets get --app-name="webapp" apikey Name Value Latest Version Created At apikey **************** 1 2023-06-09T01:03:29.708Z
Use the
--plaintext
parameter to retrieve the secret as plain text.$ vlt secrets get --app-name="webapp" --plaintext apikey 123WEOIN381$%847
Tip
Refer to the HCP Vault Secrets Quick Start tutorials to learn more.