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:
-
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:
-
Verify your installation:
Configuring the CLI
You must configure a repository site before you can log in. Configuring the site tellsconda-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
- Default site name
- Custom site name
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: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.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
.condarc. You must set at least one default channel for the wizard to continue.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
Open your Leave the rest of your
.condarc file and delete the following lines:.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.