Install the SecretHub CLI
Install the CLI
MacOS
To install the CLI using Homebrew, run:
brew install secrethub/tools/secrethub-cli
Download the latest Darwin amd64 release.
To install, extract it to a directory of your choosing, for example:
mkdir -p /usr/local/secrethub
tar -C /usr/local/secrethub -xzf secrethub-vx.x.x-os-architecture.tar.gz
Note: depending on your OS configuration, you may need root privileges to write to the
/usr/local
directory.
Ensure the binary is accessible by symlinking to it from a directory that is on your PATH
environment variable, for example:
ln -s /usr/local/secrethub/bin/secrethub /usr/local/bin/secrethub
Linux
To install the CLI with apt-get
, add the SecretHub repository to your sources.list
:
echo "deb [trusted=yes] https://apt.secrethub.io stable main" > /etc/apt/sources.list.d/secrethub.sources.list && apt-get update
Then, use apt-get install
to install the CLI:
apt-get install -y secrethub-cli
Shorthand
You can also use this one-liner instead:
curl https://apt.secrethub.io | bash
To install the CLI using yum
, first add the SecretHub repo to your /etc/yum/repos.d
:
curl https://yum.secrethub.io/secrethub.repo -o /etc/yum/repos.d/secrethub.repo --create-dirs
Then, install the CLI like any other yum
package:
yum install secrethub-cli
Shorthand
You can also use this one-liner instead:
curl https://yum.secrethub.io | bash
Or you can link to the GitHub release directly, but you won’t be able to automatically yum update
later on:
yum install https://github.com/secrethub/secrethub-cli/releases/download/v0.44.0/secrethub-v0.44.0-linux-amd64.rpm
You can install the CLI from our Alpine repository using this one-liner:
apk add --repository https://alpine.secrethub.io/alpine/edge/main --allow-untrusted secrethub-cli
To install the CLI on Debian/Ubuntu, download the latest Debian amd64
release and install it with dpkg
:
curl -sLJO https://deb.secrethub.io/amd64
dpkg -i secrethub-cli-amd64.deb
rm secrethub-cli-amd64.deb
To update the CLI, you can just re-run this command.
For other architectures or earlier versions, see the complete list of CLI releases.
Use your favorite AUR helper to install the secrethub-cli
package. For example:
yay -S secrethub-cli
Download the latest amd64 release. For other architectures, see the complete list of CLI releases.
To install, extract it to a directory of your choosing, for example:
mkdir -p /usr/local/secrethub
tar -C /usr/local/secrethub -xzf secrethub-vx.x.x-os-architecture.tar.gz
Note: depending on your OS configuration, you may need root privileges to write to the
/usr/local
directory.
Ensure the binary is accessible by symlinking to it from a directory that is on your PATH
environment variable, for example:
ln -s /usr/local/secrethub/bin/secrethub /usr/local/bin/secrethub
Windows
On Windows, you can install the CLI using a standard Windows installer.
Download the latest amd64 .msi
file and follow the installation wizard.
For other architectures, see the complete list of CLI releases.
To install the CLI using Scoop, first add the SecretHub bucket:
scoop bucket add secrethub https://github.com/secrethub/scoop-secrethub
Afterwards, run this to actually install the CLI:
scoop install secrethub-cli
To download and install the secrethub
CLI, run the following in Powershell as an Administrator:
iwr https://get.secrethub.io/windows | iex
And you’re done.
Note: this works for Windows Server 2012 R2, Windows 8, and upwards. For older operating systems (e.g. Windows Server 2008 R2), use the equivalent more verbose command:
(New-Object System.Net.WebClient).DownloadString("https://get.secrethub.io/windows") | iex
Download the latest amd64 release. For other architectures, see the complete list of CLI releases.
To install, extract it to a directory of your choosing and ensure the directory is on your PATH
.
Other
To install the CLI with NPM, run:
npm install -g @secrethub/cli
You can also include the CLI as a dev dependency to your project:
npm install --save-dev @secrethub/cli
Global install as root
To do a global install as root
, you have to run NPM with the unsafe-perm
setting.
You can do this by using the --unsafe-perm
flag:
npm install -g --unsafe-perm @secrethub/cli
Or by updating your NPM config:
npm config set unsafe-perm true
npm install -g @secrethub/cli
You can also choose to run the CLI as an isolated Docker container instead.
docker run -it -v $HOME/.secrethub:/root/.secrethub secrethub/cli
And optionally create an alias for it:
alias secrethub='docker run -it -v $HOME/.secrethub:/root/.secrethub secrethub/cli'
Note: some features of the CLI may not be available by default in Docker, like writing to the clipboard with the
--clip
flag or piping a secret to thewrite
command.
Test your Installation
You can verify your installation by running the following command:
secrethub --version
If you see the current version of the installation, then your installation was successful.
Next Steps
If this is your first SecretHub installation, check out the Get Started guide.
If you just installed SecretHub on a second device for personal use, check out Using Multiple Devices.
If the new installation is not intended for human use, but for example for a server, CI/CD pipeline or Docker container, check out service accounts.