anaconda-auth is a client library and CLI for authenticating with Anaconda APIs and securely storing API keys. This package provides centralized authentication for the Anaconda ecosystem.
Installation
Basic usage
Log in to Anaconda
This command opens your browser to authenticate your Anaconda account. Once completed, an API key is stored securely in your/.anaconda/keyring.
Check authentication status
This command displays information about the currently signed-in user.Display your API key
This command prints the API key for the signed-in user (useful for non-interactive environments).Logout
This command removes the stored API key from your keyring.Configuration
Configuration comes from multiple sources. When the same setting appears in more than one place, the highest-priority source wins:ANACONDA_AUTH_*environment variables (highest priority).envfile in the current working directory- Site settings (
[sites.<NAME>]) in/.anaconda/config.toml - Global plugin settings (
[plugin.auth]) in/.anaconda/config.toml - Conda context (proxy servers, SSL settings) from
.condarc
Site configuration
Useanaconda sites add to register the Anaconda Platform domain you want to authenticate against:
[sites] entry to .anaconda/config.toml and sets it as the default site. To verify, run anaconda sites list. For the full list of site management commands, see sites.
If you are using anaconda.com, no site configuration is needed.
[sites.<name>] section. When a parameter is not set on the site, the value from [plugin.auth] is used as a fallback. For more information on site configuration, see the sites command reference.
Global options
The[plugin.auth] section of /.anaconda/config.toml sets defaults that apply across all sites.
Example configuration
my-platform site but remains enabled as the default for any other site.
Non-interactive usage
API keys issued byanaconda auth login are valid for one year. On systems without interactive browser access, there are several ways to authenticate:
- Environment variable
- Copy the keyring file
- Device flow
- On a system with browser access, run
anaconda auth api-keyto get your API key. - On the non-interactive system, set the
ANACONDA_AUTH_API_KEYenvironment variable (or add it to a.envfile in your working directory).