Install HCP CLI
The hcp
CLI is available as a pre-compiled binary or as a package for several
operating systems.
Homebrew is a free and open source package management system
for Mac OS X. Install the official hcp
CLI
formula from the terminal.
Install the HashiCorp tap, a repository of all of the HashiCorp Homebrew packages.
$ brew tap hashicorp/tap
Install
hcp
withhashicorp/tap/hcp
.$ brew install hashicorp/tap/hcp
Note
This installs a signed binary and is automatically updated with every new official release.
Run
brew upgrade
to upgrade to the latest version.$ brew upgrade hashicorp/tap/hcp
Verify the installation
Verify the HCP CLI was installed correctly with the hcp
command. This will
return a list of commands and flags you can interact with.
$ hcpUSAGE hcp <command> [Optional Flags]DESCRIPTION The HCP Command Line Interface is a unified tool to manage your HCP services.COMMAND GROUPS auth: Authenticate to HCP. iam: Identity and access management. organizations: Interact with an existing organization. profile: View and edit HCP CLI properties. projects: Create and manage projects. waypoint: Manage Waypoint.COMMANDS version: Display the HCP CLI version.GLOBAL FLAGS --debug Enable debug output. --format=FORMAT Sets the output format. --profile=NAME The profile to use. If omitted, the currently selected profile will be used. --project=ID The HCP Project ID to use. If omitted the current project set in the configuration is used. --quiet Minimizes output.
Install tab autocomplete
Note
If you installed the CLI using one of the Linux packages, it will have automatically installed autocomplete.
Install autocompletion for the HCP CLI.
$ hcp -autocomplete-install
For the autocomplete to take effect, either create a new terminal session or source your terminal configuration.
To uninstall autocompletion for the HCP CLI, use -autocomplete-uninstall
.
$ hcp -autocomplete-uninstall