|
| 1 | +--- |
| 2 | +sidebar_position: 3.2 |
| 3 | +id: "secrets" |
| 4 | +title: "Secrets" |
| 5 | +--- |
| 6 | + |
| 7 | +import { VersionBadge } from "@site/src/components/versionbadge"; |
| 8 | + |
| 9 | +# Secrets |
| 10 | + |
| 11 | +<VersionBadge version="v0.13" /> |
| 12 | + |
| 13 | +Wave Terminal provides a secure way to store sensitive information like passwords, API keys, and tokens. Secrets are stored encrypted in your system's native keychain (macOS Keychain, Windows Credential Manager, or Linux Secret Service), ensuring your sensitive data remains protected. |
| 14 | + |
| 15 | +## Why Use Secrets? |
| 16 | + |
| 17 | +Secrets in Wave Terminal allow you to: |
| 18 | + |
| 19 | +- **Store SSH passwords** - Automatically authenticate to SSH connections without typing passwords |
| 20 | +- **Manage API keys** - Keep API tokens, keys, and credentials secure |
| 21 | +- **Share across sessions** - Access your secrets from any terminal block or remote connection |
| 22 | +- **Avoid plaintext storage** - Never store sensitive data in configuration files or scripts |
| 23 | + |
| 24 | +## Opening the Secrets UI |
| 25 | + |
| 26 | +There are several ways to access the secrets management interface: |
| 27 | + |
| 28 | +1. **From the widgets bar** (recommended): |
| 29 | + - Click the **<i className="fa-gear fa-solid fa-sharp"/>** settings icon on the widgets bar |
| 30 | + - Select **Secrets** from the menu |
| 31 | + |
| 32 | +2. **From the command line:** |
| 33 | + ```bash |
| 34 | + wsh secret ui |
| 35 | + ``` |
| 36 | + |
| 37 | + |
| 38 | +The secrets UI provides a visual interface to view, add, edit, and delete secrets. |
| 39 | + |
| 40 | +## Managing Secrets via CLI |
| 41 | + |
| 42 | +Wave Terminal provides a complete CLI for managing secrets from any terminal block: |
| 43 | + |
| 44 | +```bash |
| 45 | +# List all secret names (not values) |
| 46 | +wsh secret list |
| 47 | + |
| 48 | +# Get a specific secret value |
| 49 | +wsh secret get MY_SECRET_NAME |
| 50 | + |
| 51 | +# Set a secret (format: name=value, no spaces around =) |
| 52 | +wsh secret set GITHUB_TOKEN=ghp_xxxxxxxxxx |
| 53 | +wsh secret set DB_PASSWORD=super_secure_password |
| 54 | + |
| 55 | +# Delete a secret |
| 56 | +wsh secret delete MY_SECRET_NAME |
| 57 | +``` |
| 58 | + |
| 59 | +## Secret Naming Rules |
| 60 | + |
| 61 | +Secret names must match the pattern: `^[A-Za-z][A-Za-z0-9_]*$` |
| 62 | + |
| 63 | +This means: |
| 64 | +- Must start with a letter (A-Z or a-z) |
| 65 | +- Can only contain letters, numbers, and underscores |
| 66 | +- Cannot contain spaces or special characters |
| 67 | + |
| 68 | +**Valid names:** `MY_SECRET`, `ApiKey`, `ssh_password_1` |
| 69 | +**Invalid names:** `123_SECRET`, `my-secret`, `secret name` |
| 70 | + |
| 71 | +## Using Secrets with SSH Connections |
| 72 | + |
| 73 | +<VersionBadge version="v0.13" /> |
| 74 | + |
| 75 | +Secrets can be used to automatically provide passwords for SSH connections, eliminating the need to type passwords repeatedly. |
| 76 | + |
| 77 | +### Configure in connections.json |
| 78 | + |
| 79 | +Add the `ssh:passwordsecretname` field to your connection configuration: |
| 80 | + |
| 81 | +```json |
| 82 | +{ |
| 83 | + "myserver": { |
| 84 | + "ssh:hostname": "example.com", |
| 85 | + "ssh:user": "myuser", |
| 86 | + "ssh:passwordsecretname": "SERVER_PASSWORD" |
| 87 | + } |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +Then store your password as a secret: |
| 92 | + |
| 93 | +```bash |
| 94 | +wsh secret set SERVER_PASSWORD=my_actual_password |
| 95 | +``` |
| 96 | + |
| 97 | +Now when Wave connects to `myserver`, it will automatically use the password from your secret store instead of prompting you. |
| 98 | + |
| 99 | +### Benefits |
| 100 | + |
| 101 | +- **Security**: Password stored encrypted in your system keychain |
| 102 | +- **Convenience**: No need to type passwords for each connection |
| 103 | +- **Flexibility**: Update passwords by changing the secret, not the configuration |
| 104 | + |
| 105 | +## Security Considerations |
| 106 | + |
| 107 | +- **Encrypted Storage**: Secrets are stored encrypted in your Wave configuration directory. The encryption key itself is protected by your operating system's secure credential storage (macOS Keychain, Windows Credential Manager, or Linux Secret Service). |
| 108 | + |
| 109 | +- **No Plaintext**: Secrets are never stored unencrypted in logs or accessible files. |
| 110 | + |
| 111 | +- **Access Control**: Secrets are only accessible to Wave Terminal. |
| 112 | + |
| 113 | + |
| 114 | +## Storage Backend |
| 115 | + |
| 116 | +Wave Terminal automatically detects and uses the appropriate secret storage backend for your operating system: |
| 117 | + |
| 118 | +- **macOS**: Uses the macOS Keychain |
| 119 | +- **Windows**: Uses Windows Credential Manager |
| 120 | +- **Linux**: Uses the Secret Service API (freedesktop.org specification) |
| 121 | + |
| 122 | +:::warning Linux Secret Storage |
| 123 | +On Linux systems, Wave requires a compatible secret service backend (typically GNOME Keyring or KWallet). These are usually pre-installed with your desktop environment. If no compatible backend is detected, you won't be able to set secrets, and the UI will display a warning. |
| 124 | +::: |
| 125 | + |
| 126 | +## Troubleshooting |
| 127 | + |
| 128 | +### "No appropriate secret manager found" |
| 129 | + |
| 130 | +This error occurs on Linux when no compatible secret service backend is available. Install GNOME Keyring or KWallet and ensure the secret service is running. |
| 131 | + |
| 132 | +### Secret not found |
| 133 | + |
| 134 | +Ensure the secret name is spelled correctly (names are case-sensitive) and that the secret exists: |
| 135 | + |
| 136 | +```bash |
| 137 | +wsh secret list |
| 138 | +``` |
| 139 | + |
| 140 | +### Permission denied on Linux |
| 141 | + |
| 142 | +The secret service may require you to unlock your keyring. This typically happens after login. Consult your desktop environment's documentation for keyring management. |
| 143 | + |
| 144 | +## Related Documentation |
| 145 | + |
| 146 | +- [Connections](/connections) - Learn about SSH connections and configuration |
| 147 | +- [wsh Command Reference](/wsh-reference#secret) - Complete CLI command documentation for secrets |
0 commit comments