Getting started
- Installing the CLI
- Signing up for an account
- Creating a repository
- Writing a secret
- Using secret versions
- Defining secrets as code
- Writing secrets to files
- Injecting secrets into config files
- Setting secrets as environment variables
- Next steps
Reference docs
Security docs
Writing our first secrets
Now that we have a testing repository set up, we can start writing some secrets. Let’s start simple by running the following command and typing Hello World
when prompted:
secrethub write $SH_USERNAME/testing/hello
As we can see, the secret hello
is now written to SecretHub.
Because we know you love to script,
secrethub write
also accepts input onstdin
.
If we now want to read our newly created secret, we can run:
secrethub read $SH_USERNAME/testing/hello
Pro tip: we can use SecretHub for passwords too
While SecretHub is mainly meant for infrastructure secrets, we often find it can be equally useful for managing our passwords.
Whenever we want to generate a random password, we can use the secrethub generate
command. The following line generates a random password of 22 characters for some example.com
website:
secrethub generate rand $SH_USERNAME/testing/example.com
When we need to type in a password somewhere, we can use the secrethub read
with the --clip
flag.
This copies the secret value to our clipboard for 45 seconds.
secrethub read --clip $SH_USERNAME/testing/example.com
To read more on these commands, we can always use the secrethub <command> --help
syntax.
Let’s move on to using secret versions.