Skip to main content

Storing Credentials

Store your credentials once instead of passing --api-key on every command:
Settings use the same names as the flags: api-key, api-url, proxy, and ca-cert. They live in ~/.scanoss/settings.json:
The command line always uses the dashed names (api-key); snake_case is the file’s format, not a second way to type a key.

Precedence

Every setting resolves the same way, and each has a matching flag:
The environment variable is the setting name in upper case with a SCANOSS_ prefix: SCANOSS_API_KEY, SCANOSS_API_URL, SCANOSS_PROXY, SCANOSS_CA_CERT. An empty value from the environment or the file is treated as unset and falls through to the next source.
--verbose reports which source won for each setting (the source only, never the key’s value).

Inspecting

config list shows the value each command will actually use, and where it came from:
The API key is never printed. list and get always render it as ********, there’s no flag that reveals it, so it can’t land in your shell history or a CI log. config get api-key therefore only tells you whether it’s set (exit code 0 or 1). Scripts that need the value should use $SCANOSS_API_KEY; to read your own file, open it directly with cat "$(scanoss-cli config path)".
Non-secret values print normally, so config get composes:

On-Prem Endpoint

A custom API URL may run keyless, so pointing the CLI at an internal deployment is one command:

Proxy and Custom CA

HTTP_PROXY, HTTPS_PROXY, and NO_PROXY are honoured with no flags. --proxy overrides them for one run, and --ca-cert trusts a CA the system pool doesn’t have, an internal endpoint, or a proxy that intercepts TLS:
The CA is added to the system pool, so the public API keeps working, and verification stays on, unlike --ignore-cert-errors. Both flags work on every command that reaches the API.
Proxy auto-configuration (PAC) is not supported: read the proxy out of the PAC file and pass it with --proxy.
Both can be stored, so neither flag has to be repeated:
A stored proxy takes precedence over HTTP_PROXY/HTTPS_PROXY. --ignore-cert-errors is not storable, turning off verification stays a per-run choice.

CI

Use the environment instead of a config file, no config set, and no key on the command line where it would land in build logs:

Rotating and Removing

Hand-editing the file is supported, and keys this version doesn’t recognize are left untouched by config set.