Store your API key in the keyring
For advanced users. By default, yasp-toolkit reads your API key from the YASP_API_KEY environment variable — see Persist your API key. As an alternative, you can store the key in your operating system's keyring so every command picks it up automatically, without the secret sitting in an environment variable, a shell profile, or your shell history.
When to use the keyring
- You want the API key out of your shell environment and history.
- You're on a workstation with an OS keyring backend (macOS Keychain, GNOME Keyring, KWallet, …).
On headless servers with no keyring backend, stay with YASP_API_KEY — keyring set fails there with NoKeyringError.
Store the key
yasp-toolkit keyring set
You're prompted for the key, which is verified against the API before it's stored for the default host (https://compile.yasp.ai/api). Once stored, every yasp-toolkit command uses it automatically.
YASP_API_KEY still takes precedence when it's set, so you can override the stored key for a single shell without touching the keyring.
More keyring commands
See the yasp-toolkit keyring reference for list, get, and unset, storing keys for specific hosts, and non-interactive input via --password-file.