While some secrets have to be manually generated (e.g. by clicking through a graphical user interface), others can be programmatically generated.
That’s where the
generate command comes in.
When you want to generate a random password (or any random sequence of characters for that matter), you can use the
secrethub generate [options] <namespace>/<repo>[/<dir>]/<secret>
generate rand command generates a random string and writes it to the given path.
- The path to write the generated secret to.
- Include symbols in the generated secret. Because not all systems allow special characters, they are disabled by default.
Generated passwords consist of lowercase letters (
a-z), uppercase letters (
A-Z) and numbers (
0-9). By enabling symbols, the following special characters are added into the mix:
- The length of the generated secret. Defaults to 22.
- Copy the generated value to the clipboard. The clipboard is automatically cleared after 45 seconds.