Skip to main content
Use ana login to connect the Anaconda CLI to your account. Once you’re logged in, ana uses your saved credentials for commands that need authentication.

Log in

To log in through your browser, run:
Follow the link and activation code displayed in your terminal. After you sign in, ana saves your credentials in the keyring at the following location:
%USERPROFILE%\.anaconda\keyring
If your browser does not open, open the displayed link yourself. To stop ana from opening a browser automatically, set ANA_OPEN_BROWSER=false.

Usage and options

The login command also accepts an API key and the following options:
Arguments Options The ana auth login, ana auth logout, and ana auth whoami commands are aliases of ana login, ana logout, and ana whoami.

Log in with an API key

Create a key in API key management, then run:
Paste your key at the prompt. Input is hidden. Using the prompt avoids leaving the key in your shell history.

Non-interactive login for CI/CD

For automated workflows, store your API key in your CI provider’s secret storage and expose it as ANACONDA_API_KEY. Pass the key to ana without an interactive prompt:
Here, - tells ana to read the key from standard input. --force replaces any credentials already saved on the runner. Omit --force if those credentials should be kept.
Setting ANACONDA_AUTH_API_KEY alone does not log ana in. Run the login step above before commands that need authentication. For package publishing examples, see Anaconda GitHub Actions.
Never hardcode API keys or commit them to version control. Keep the keyring file private, and do not include it in build artifacts or container images.

Display your stored API key

To retrieve your saved key, run:
This prints the full secret. Do not run it in an unmasked CI log or share its output.

Display account information

To check which account you’re using, run:
For JSON output, use:

Log out

To remove your saved credentials, run:
Logout removes the credential for your current Anaconda domain from the keyring. To revoke the API key itself, follow the API key management link displayed by the command. If you used MCP setup, your AI clients have their own copies of the key. Logging out of ana does not remove those copies. Revoke the key when access should end.

What’s next

With authentication in place, you can configure package sources or install additional tools. To change the keyring location or use another Anaconda domain, see Configuration.