Skip to content

yasp-toolkit keyring

Manage yasp API keys stored in your OS keyring. Keys are scoped per API base URL; the active URL is $YASP_API_HOST if set, otherwise https://compile.yasp.ai/api. YASP_API_KEY overrides the keyring at runtime.

Headless hosts (no keyring backend)

On a server with no OS keyring backend, keyring set fails with NoKeyringError. Skip the keyring entirely and set the YASP_API_KEY environment variable to your API key — every yasp-toolkit command uses it when present.

Don't have a token yet? See Get your API Token to create one.

set

Prompt for an API key, verify it against the API, and store it in the keyring.

Usage:

$ yasp-toolkit keyring set [OPTIONS] [api_base_url]
Argument Default Description
api_base_url API base URL the API key authenticates against. [env var: YASP_API_HOST; default: https://compile.yasp.ai/api]
Option Default Description
--password-file <filename> Read the API key from a file. Use '-' for stdin.

Example session:

$ yasp-toolkit keyring set
API token for https://compile.yasp.ai/api: ********
Stored token for https://compile.yasp.ai/api.

If the API rejects the API key, the existing keyring entry (if any) is left untouched:

Token rejected for https://compile.yasp.ai/api/token — not stored.

For non-interactive flows, pipe the API key via --password-file:

printf '<API_KEY>' | yasp-toolkit keyring set --password-file - https://compile.yasp.ai/api

list

List API base URLs that have an API key stored in the keyring.

Usage:

$ yasp-toolkit keyring list [OPTIONS] [api_base_url]
Argument Default Description
api_base_url API base URL the API key authenticates against. [env var: YASP_API_HOST; default: https://compile.yasp.ai/api]

Options: * --help: Show this message and exit. Example output:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━┓
┃ API Base URL                ┃ API Token   ┃ Valid ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━┩
│ https://compile.yasp.ai/api │ yasp_XXXXX… │ yes   │
└─────────────────────────────┴─────────────┴───────┘

The full secret is never echoed; the Valid column re-checks the API key against the API.

get

Print the stored API key for the given API base URL to stdout.

Usage:

$ yasp-toolkit keyring get [OPTIONS] [api_base_url]
Argument Default Description
api_base_url API base URL the API key authenticates against. [env var: YASP_API_HOST; default: https://compile.yasp.ai/api]

Options: * --help: Show this message and exit. Useful for inlining the key into another command without writing it to a file — for example, passing it to a remote worker over SSH:

ssh <target> docker run  -e YASP_API_KEY=$(yasp-toolkit keyring get https://compile.yasp.ai/api) 

unset

Remove the keyring entry for the given API base URL.

Usage:

$ yasp-toolkit keyring unset [OPTIONS] [api_base_url]
Argument Default Description
api_base_url API base URL the API key authenticates against. [env var: YASP_API_HOST; default: https://compile.yasp.ai/api]

Options: * --help: Show this message and exit.