Installing the SecretHub CLI

Before creating an account and writing our first secrets, we first need to install the SecretHub CLI, called secrethub.

Step 1: installing the CLI on the platform of choice

Depending on the platform we’re running on, we can choose an installation method below. For common errors we can checkout the troubleshooting section of the reference documenation.

Linux

To install the secrethub CLI on Linux, we fetch and execute the install script in the terminal:

# Run in terminal on Linux
curl https://get.secrethub.io/linux | bash

Note that the install script will ask for root privileges when we don’t have them already.

To display the install script without running it, we can run:

curl https://get.secrethub.io/linux

macOS

To install the secrethub CLI on macOS, we fetch and execute the install script in the terminal:

# Run in terminal on macOS
curl https://get.secrethub.io/darwin | bash

Note that the install script will ask for root privileges when we don’t have them already.

To display the install script without running it, we can run:

curl https://get.secrethub.io/darwin

Windows

To install the secrethub CLI on Windows, we fetch and execute the install script in Powershell. On Windows Server 2012 R2, Windows Server 2016 R2, Windows 8, or Windows 10 (versions that run PowerShell v3.0 or higher) we can run the following command. We can run this from anywhere, as long as we do it in a PowerShell session with Administrator Privileges.

# Run in Windows Powershell as Administrator
iwr https://get.secrethub.io/windows | iex 

On Windows Server 2008 R2 (or other operating systems with PowerShell v2 installed), we need a slightly longer expression to achieve the same result:

# Run in Windows Powershell as Administrator
(New-Object System.Net.WebClient).DownloadString("https://get.secrethub.io/windows") | iex

The secrethub CLi should have been installed on your system now. Let’s verify if we can access it next.

Note that we can display the install script without running it like this:

iwr https://get.secrethub.io/windows

Step 2: Verifying the CLI is correctly installed

After installing the CLI, we can verify whether it was installed correctly by running:

# Verify the installation
secrethub --version
# Show usage text
secrethub --help

And we’re done! The SecretHub CLI has now been successfully installed and is ready to be used. Let’s sign up for a SecretHub account.