To write a secret to a path on SecretHub, you can use the
secrethub write [options] <path>
This automatically encrypts your secret and writes it to a new version at the path you provide.
Depending on how you configure the command, it reads the secret from the following inputs:
- If the
--clipflag is provided, it reads from the clipboard.
- If input is piped, it reads from
echo "hello world" | secrethub write path/to/secret
- If no other input is given, it aks you to type in the secret value.
- The path to write the secret to. Note that secrets are append only, so
writealways creates a new version of a secret.
- Use clipboard content as input. This can be useful when copy-pasting a value from a graphical user interface.
- Do not trim leading and trailing whitespace in the secret. Use this when you want to preserve the original content of the secret, regardless of whether your system adds a newline to the input (as is common on e.g. Posix systems).