| title | thv secret set | ||
|---|---|---|---|
| hide_title | true | ||
| description | Reference for ToolHive CLI command `thv secret set` | ||
| last_update |
|
||
| slug | thv_secret_set | ||
| mdx |
|
Set a secret
Create or update a secret with the specified name.
This command supports two input methods for maximum flexibility:
Piped input:
When you pipe data to the command, it reads the secret value from stdin. Examples:
$ echo "my-secret-value" | thv secret set my-secret
$ cat secret-file.txt | thv secret set my-secret
Interactive input:
When you don't pipe data, the command prompts you to enter the secret value securely. The input remains hidden for security. Example:
$ thv secret set my-secret
Enter secret value (input will be hidden): _
The command stores the secret securely using your configured secrets provider. Note that some providers (like 1Password) are read-only and do not support setting secrets.
thv secret set <name> [flags]
-h, --help help for set
--debug Enable debug mode
- thv secret - Manage secrets