Skip to main content
The conda-repo-cli package is the command-line interface (CLI) tool for interacting with Package Security Manager. You can use it to perform most of the actions available through the graphical user interface, including managing channels, mirrors, policies, packages, and service accounts.
The actions you can perform in the CLI are determined by your group/role permission levels. If you are unsure of your permissions or need additional permissions, contact your Package Security Manager administrator.

Installing the CLI

conda-repo-cli is included with Anaconda Distribution. If you installed Miniconda, you’ll need to install the package:
  1. Open Anaconda Prompt (Terminal on macOS/Linux) and run:
    As an administrator, you can mirror or upload this package into a public channel within your Package Security Manager instance, allowing your users to install it by running:
  2. Verify your installation:

Configuring the CLI

You must configure a repository site before you can log in. Configuring the site tells conda-repo-cli which Package Security Manager URL to connect to. This information is recorded in your .conda/repo-cli-config.yaml file.
1

Set your Package Security Manager site

To add your Package Security Manager URL and set it as the default site, run:
2

Enable OAuth or SAML Optional

If your Package Security Manager uses OAuth or SAML for authentication, run the following command to enable the standard authorization flow:
3

Confirm your configuration

To view your configuration, run:
The output shows the path to your .conda/repo-cli-config.yaml file and its contents. Confirm that the url for your default site matches your Package Security Manager URL.

Logging in

To log in, run the following command:
When prompted, enter your Package Security Manager username and password. For example:
If you are using OAuth or SAML, running conda repo login opens a browser window where you log in with your organization’s SSO credentials. After you log in, the window displays Token Received. Close the browser window and return to your terminal.
To confirm that you’re logged in, run:

Configuring conda to use Package Security Manager

The .condarc configuration wizard points conda at your Package Security Manager, so conda install and other conda commands use your Package Security Manager channels. It adds channels from your organization to your .condarc file and sets the channel_alias for your deployment. You must be logged in to run the wizard.
1

Run the wizard

The wizard shows channels from your Package Security Manager organization and guides you through adding them to your .condarc. You must set at least one default channel for the wizard to continue.
Misspelled channel names are not accepted. If you enter a channel name that does not match an existing channel, a warning appears and no channel is added.
Only add channels that contain packages. If any default channel is empty, every conda command fails with UnavailableInvalidChannel: HTTP 404 Not Found.
Your output looks something like this:
Example command workflow
The wizard adds each default channel to the top of the default_channels list, so the list in your .condarc ends up in the reverse of the order you entered. Conda searches channels from the top of the list down, so enter your highest-priority channel last. To check the final order, run:
2

Remove the wizard's channel settings

This is a known issue in conda-repo-cli. The wizard adds a channel_settings block to your .condarc that prevents conda from authenticating to Package Security Manager. Until you remove it, conda commands fail with AnacondaAuthError: Received authentication error (401).
Open your .condarc file and delete the following lines:
Leave the rest of your .condarc unchanged. Conda uses the token that conda repo login saved, so you don’t need to install a separate token.
3

Confirm conda can reach your channels

Search for a package in one of your default channels:
The results list your Package Security Manager channels in the Channel column.
If the wizard creates problems with your .condarc, revert the changes:
For a complete list of commands and options, see the command reference.