You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/wsh-reference.mdx
+86Lines changed: 86 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -895,4 +895,90 @@ wsh blocks list --workspace=12d0c067-378e-454c-872e-77a314248114
895
895
wsh blocks list --json
896
896
```
897
897
898
+
899
+
---
900
+
901
+
## secret
902
+
903
+
The `secret`command provides secure storage and management of sensitive information like API keys, passwords, and tokens. Secrets are stored using your system's native secure storage backend (Keychain on macOS, Secret Service on Linux, Credential Manager on Windows).
904
+
905
+
Secret names must start with a letter and contain only letters, numbers, and underscores.
906
+
907
+
### get
908
+
909
+
```sh
910
+
wsh secret get [name]
911
+
```
912
+
913
+
Retrieve and display the value of a stored secret.
914
+
915
+
Examples:
916
+
917
+
```sh
918
+
# Get an API key
919
+
wsh secret get github_token
920
+
921
+
# Use in scripts
922
+
export API_KEY=$(wsh secret get my_api_key)
923
+
```
924
+
925
+
### set
926
+
927
+
```sh
928
+
wsh secret set [name]=[value]
929
+
```
930
+
931
+
Store a secret value securely. This command requires an appropriate system secret manager to be available and will fail if only basic text storage is available.
932
+
933
+
Examples:
934
+
935
+
```sh
936
+
# Set an API token
937
+
wsh secret set github_token=ghp_abc123xyz
938
+
939
+
# Set a database password
940
+
wsh secret set db_password=mySecurePassword123
941
+
```
942
+
943
+
:::warning
944
+
The `set` command requires a proper system secret manager (Keychain, Secret Service, or Credential Manager). It will not work with basic text storage for security reasons.
945
+
:::
946
+
947
+
### list
948
+
949
+
```sh
950
+
wsh secret list
951
+
```
952
+
953
+
Display all stored secret names (values are not shown).
954
+
955
+
Example:
956
+
957
+
```sh
958
+
# List all secrets
959
+
wsh secret list
960
+
```
961
+
962
+
### delete
963
+
964
+
```sh
965
+
wsh secret delete [name]
966
+
```
967
+
968
+
Remove a secret from secure storage.
969
+
970
+
Examples:
971
+
972
+
```sh
973
+
# Delete an API key
974
+
wsh secret delete github_token
975
+
976
+
# Delete multiple secrets
977
+
wsh secret delete old_api_key
978
+
wsh secret delete temp_token
979
+
```
980
+
981
+
:::tip
982
+
Use secrets in your scripts to avoid hardcoding sensitive values. Secrets work across remote machines - store an API key locally with `wsh secret set`, then access it from any SSH or WSL connection with `wsh secret get`. The secret is securely retrieved from your local machine without needing to duplicate it on remote systems.
0 commit comments