@@ -15,84 +15,82 @@ configuration files.
1515
1616## Secrets providers
1717
18- ToolHive supports multiple secret providers:
18+ ToolHive supports multiple secret providers to fit different security and
19+ workflow requirements:
1920
20- - ` encrypted ` (default) - ToolHive encrypts secrets using a password that it
21- stores in your operating system's keyring.
22- - ` 1password ` - ToolHive retrieves secrets from a 1Password vault.
21+ - ` encrypted ` - ToolHive encrypts secrets using a password stored in your
22+ operating system's keyring
23+ - ` 1password ` - ToolHive retrieves secrets from a 1Password vault
2324
24- <Tabs groupId = ' secrets-provider' queryString = ' secrets-provider' >
25- <TabItem value = ' encrypted' label = ' Encrypted (default)' default >
25+ You can use only one provider at a time. To select your preferred provider, run:
2626
27- The ` encrypted ` provider is the default secrets provider. When you use a
28- [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) command for the first time,
29- ToolHive prompts you for a password to encrypt and decrypt your secrets.
27+ ``` bash
28+ thv secret setup
29+ ```
3030
31- ToolHive stores the encryption password in your operating system's keyring
32- (Keychain Access on macOS, dbus/Gnome Keyring on Linux). This means you don't
33- need to enter it every time you use a
34- [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) command.
31+ If you plan to use 1Password, first set up a 1Password service account and
32+ obtain an API token. See the 1Password tab below for details.
3533
36- To explicitly use the ` encrypted ` provider (or switch back to it from another
37- provider), run:
34+ < Tabs groupId = ' secrets- provider' >
35+ < TabItem value = ' encrypted ' label = ' Encrypted ' default >
3836
39- ``` bash
40- thv config secrets-provider encrypted
41- ```
37+ When you select the ` encrypted ` provider, ToolHive prompts you to create an
38+ encryption password that protects your secrets.
39+
40+ ToolHive stores this encryption password in your operating system's keyring
41+ (Keychain Access on macOS, Credential Manager on Windows, and dbus/Gnome Keyring
42+ on Linux). This means you don't need to enter the password every time you use a
43+ [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) command.
4244
4345 </TabItem >
4446 <TabItem value = ' 1password' label = ' 1Password' >
4547
4648:::note
4749
48- The ` list ` , ` set ` , and ` delete ` operations aren't currently supported with
49- 1Password.
50-
51- You can retrieve secrets using the
52- [ ` thv secret get ` ] ( ../reference/cli/thv_secret_get.md ) command and the
53- ` --secret ` parameter for [ ` thv run ` ] ( ../reference/cli/thv_run.md ) , but the
54- secret must already exist in 1Password.
50+ The 1Password provider is read-only. You can list and view secrets, but you
51+ can't create or delete them through ToolHive. Secrets must already exist in your
52+ 1Password vault.
5553
56- If you'd like to see more functionality , please
54+ If you'd like to see write operations added , please
5755[ open an issue] ( https://github.com/stacklok/toolhive/issues ) or join the
5856` #toolhive-developers ` channel in [ Discord] ( https://discord.gg/stacklok ) .
59- Contributions are also welcome!
57+ Contributions are welcome!
6058
6159:::
6260
6361To use 1Password as your secrets provider, set up a 1Password service account.
6462For detailed instructions, see the
6563[ 1Password documentation] ( https://developer.1password.com/docs/service-accounts/get-started#create-a-service-account ) .
6664
67- Next, set the ` OP_SERVICE_ACCOUNT_TOKEN ` environment variable to the 1Password
68- service account's API token, which is displayed during the service account
69- creation process. This token is required for all
70- [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) commands.
65+ Next, set the ` OP_SERVICE_ACCOUNT_TOKEN ` environment variable to your service
66+ account's API token ( displayed during the service account creation process).
67+ This token is required for all [ ` thv secret ` ] ( ../reference/cli/thv_secret.md )
68+ commands:
7169
7270``` bash
7371export OP_SERVICE_ACCOUNT_TOKEN=< your-service-account-token>
7472```
7573
76- Then, set 1Password as your ToolHive secrets provider:
74+ Then, run ` thv secret setup ` and select ` 1password ` when prompted.
7775
78- ``` bash
79- thv config secrets-provider 1password
80- ```
81-
82- To reference a secret, use the
76+ To reference a secret from 1Password, use the
8377[ 1Password secret reference] ( https://developer.1password.com/docs/cli/secret-reference-syntax )
8478URI format:
8579
8680``` text
8781op://<vault-name>/<item-name>/[section-name/]<field-name>
8882```
8983
90- For example, to retrieve a secret named ` github ` from the ` MCPVault ` vault:
84+ For example, to retrieve the ` password ` field from the ` github ` item in the
85+ ` MCPVault ` vault:
9186
9287``` bash
9388thv secret get op://MCPVault/github/password
9489```
9590
91+ Run [ ` thv secret list ` ] ( ../reference/cli/thv_secret_list.md ) to see all secrets
92+ accessible to your service account, along with their URIs.
93+
9694 </TabItem >
9795</Tabs >
9896
@@ -172,17 +170,32 @@ thv secret reset-keyring
172170
173171Then, delete the encrypted secrets file:
174172
175- On macOS:
173+ <Tabs groupId = ' os' >
174+ <TabItem value = ' macos' label = ' macOS' default >
175+
176+ ``` bash
177+ rm ~ /Library/Application\ Support/toolhive/secrets_encrypted
178+ ```
176179
177- ``` bash
178- rm ~ /Library/Application\ Support/toolhive/secrets_encrypted
179- ```
180+ </TabItem >
181+ <TabItem value = ' linux' label = ' Linux' >
180182
181- On Linux:
183+ ``` bash
184+ rm ~ /.config/toolhive/secrets_encrypted
185+ ```
182186
183- ``` bash
184- rm ~ /.config/toolhive/secrets_encrypted
185- ```
187+ </TabItem >
188+ <TabItem value = ' windows' label = ' Windows' >
189+
190+ ``` powershell
191+ Remove-Item "$env:LOCALAPPDATA\toolhive\secrets_encrypted"
192+ ```
193+
194+ </TabItem >
195+ </Tabs >
196+
197+ The next time you run a ` thv secret ` command, ToolHive prompts you to create a
198+ new encryption password and starts with a fresh secret store.
186199
187200## Use secrets with MCP servers
188201
@@ -328,7 +341,15 @@ If you can't access 1Password secrets:
328341 ```
329342
3303432 . Check that the token is valid and has the necessary permissions to access the
331- vault and item.
344+ vault and item:
345+
346+ ``` bash
347+ thv secret list
348+ ```
332349
3333503 . Make sure the secret reference URI is correct and matches the vault, item,
334- and field names in 1Password.
351+ and field names in 1Password:
352+
353+ ``` bash
354+ thv secret get op://< vault-name> /< item-name> /[section-name/]< field-name>
355+ ```
0 commit comments