To read the contents of a secret, you can use the read command:

secrethub read [options] <path>

This automatically fetches and decrypts your secret and writes it to stdout.

Alternatively, you can configure the --clip flag to write the secret to the clipboard.


<path> (string)
The path to the secret version you wish to read. It accepts paths with a version number suffix or end in :latest. When no version is specified, it assumes :latest.


-c, --clip (boolean)
Copy the secret value to the clipboard. The clipboard is automatically cleared after 45 seconds.
-o, --out-file (string)
Write the secret value to this file.
--file-mode (string)
Set the filemode for the output file. Default to 0600 (read and write for the current user) and is ignored without the --out-file flag.