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 hosts with no OS keyring backend (headless servers, containers, CI), the key is stored unencrypted in ~/.local/share/python_keyring/keyring_pass.cfg (mode 0600), and keyring set says so. YASP_API_KEY keeps it off disk.
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.
To create a new key and store it in one step, approve it in the browser with yasp-toolkit login.
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.