> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing packages with the CLI

You can upload, download, copy, move, search, and remove packages in Package Security Manager from the command line. For general information about managing packages in the GUI, see [Packages](https://anaconda.com/docs/psm-on-prem/6.8.0/user/package.md).

## Searching for packages

Use the search command to locate packages in your repository:

```sh theme={null}
conda repo search --family <FAMILY> <PACKAGE_NAME>
```

Comments

Replace \<FAMILY> with the artifact family type (`conda`, `python`, `cran`, `anaconda_project`, `anaconda_env`, `notebook`, `gra`).\\

Replace \<PACKAGE\_NAME> with the name of the package you are searching for.

The return provides a list of channels containing the package, along with version, family, build, license, and platform information:

```text theme={null}
(base) ➜  ~ conda repo search --family conda pytorch
Channel                        | Name                                     |  Version | Family       | Build      | License         | Platforms
------------------------------ | ---------------------------------------- | -------- | ------------ | ---------- | --------------- | ---------------
birds                          | pytorch                                  |   1.13.1 | conda        | 0          | BSD-3-Clause    | linux-64, osx-arm64, linux-ppc64le, osx-64, linux-s390x, linux-aarch64
snakes                         | pytorch                                  |   1.13.1 | conda        | 0          | BSD-3-Clause    | osx-64, osx-arm64

2 packages found.
Visualizing 2-2 interval.
```

## Viewing channel packages

To view the packages in a channel:

```sh theme={null}
conda repo channel --list-packages <CHANNEL_NAME>
```

Comments

Replace \<CHANNEL\_NAME> with the channel name.

## Viewing package details

To view the details of a channel's packages:

```sh theme={null}
conda repo channel --list-file <CHANNEL_NAME> --full-details
```

Comments

Replace \<CHANNEL\_NAME> with the channel name.

This returns a JSON-formatted list of all files in the channel and their metadata, including CKEY, CVE score, CVE status, file name, package name, platform, and version.

> [!TIP]
>
> On channels with many files, this command can take several minutes. To return only one package's files, use `<CHANNEL_NAME>::<PACKAGE_NAME>` instead of the channel name.

## Uploading to a channel

To upload an asset (package, project, notebook, environment) to your default channel in Package Security Manager:

```sh theme={null}
conda repo upload <FILE_PATH>
```

Comments

Replace \<FILE\_PATH> with the path to the file you are uploading.

> [!NOTE]
>
> The CLI can't detect the type of `.conda` files. When you upload a `.conda` file, add `--package-type conda`.

> [!TIP]
>
> You can upload multiple assets at the same time:
>
> ```sh theme={null}
> conda repo upload <FILE_PATH_1> <FILE_PATH_2>
> ```
>
> Comments
>
> Replace \<FILE\_PATH\_1> and \<FILE\_PATH\_2> with the paths to the files you are uploading.

To specify a destination channel:

```sh theme={null}
conda repo upload <FILE_PATH> --channel <CHANNEL_NAME>
```

Comments

Replace \<FILE\_PATH> with the path to the file you are uploading.\\

Replace \<CHANNEL\_NAME> with the channel you want to upload to.

General resource artifact (GRA) uploads require additional information:

```sh theme={null}
conda repo upload <FILE_PATH> --channel <CHANNEL_NAME> --package-type gra --name <GROUP_NAME> --version <VERSION>
```

Comments

Replace \<FILE\_PATH> with the path to the artifact you are uploading.\\

Replace \<CHANNEL\_NAME> with the channel you want to upload to.\\

Replace \<GROUP\_NAME> with an artifact group name.\\

Replace \<VERSION> with a version for your artifact upload.

Danger

Make sure to perform manual security checks on artifacts before uploading them. Automatic security scanning is not provided.

## Downloading a notebook

To download a notebook and save it to the current working directory:

```sh theme={null}
conda repo download --channel <CHANNEL_NAME> --notebook <NOTEBOOK_NAME>
```

Comments

Replace \<CHANNEL\_NAME> with the name of the channel that contains the notebook.\\

Replace \<NOTEBOOK\_NAME> with the name of the notebook you want to download.

To specify a target directory and optionally rename the file:

```sh theme={null}
conda repo download --channel <CHANNEL_NAME> --notebook <NOTEBOOK_NAME> --filename <PATH/FILENAME>
```

Comments

Replace \<CHANNEL\_NAME> with the name of the channel.\\

Replace \<NOTEBOOK\_NAME> with the name of the notebook.\\

Replace \<PATH/FILENAME> with the directory path and (optionally) a new filename.

> [!NOTE]
>
> If you do not include a filename with the directory path, the notebook's original filename is used.

## Copying a package

To copy a package to another channel (the original remains in the source channel):

```sh theme={null}
conda repo copy <ORIGIN_CHANNEL>::<PACKAGE_NAME> --destination <DESTINATION_CHANNEL>
```

Comments

Replace \<ORIGIN\_CHANNEL> with the channel containing the package.\\

Replace \<PACKAGE\_NAME> with the package name.\\

Replace \<DESTINATION\_CHANNEL> with the target channel.

To copy to a subchannel:

```sh theme={null}
conda repo copy <ORIGIN_CHANNEL>::<PACKAGE_NAME> --destination <DESTINATION_CHANNEL>/<SUBCHANNEL>
```

Comments

Replace \<ORIGIN\_CHANNEL> with the channel containing the package.\\

Replace \<PACKAGE\_NAME> with the package name.\\

Replace \<DESTINATION\_CHANNEL> with the channel that contains your subchannel.\\

Replace \<SUBCHANNEL> with the subchannel name.

## Moving a package

To move a package to another channel (the package is removed from the source channel):

```sh theme={null}
conda repo move <ORIGIN_CHANNEL>::<PACKAGE_NAME> --destination <DESTINATION_CHANNEL>
```

Comments

Replace \<ORIGIN\_CHANNEL> with the channel containing the package.\\

Replace \<PACKAGE\_NAME> with the package name.\\

Replace \<DESTINATION\_CHANNEL> with the target channel.

To move to a subchannel:

```sh theme={null}
conda repo move <ORIGIN_CHANNEL>::<PACKAGE_NAME> --destination <DESTINATION_CHANNEL>/<SUBCHANNEL>
```

Comments

Replace \<ORIGIN\_CHANNEL> with the channel containing the package.\\

Replace \<PACKAGE\_NAME> with the package name.\\

Replace \<DESTINATION\_CHANNEL> with the channel that contains your subchannel.\\

Replace \<SUBCHANNEL> with the subchannel name.

## Removing a package

To remove a package from a channel:

```sh theme={null}
conda repo remove <CHANNEL_NAME>::<PACKAGE_NAME>
```

Comments

Replace \<CHANNEL\_NAME> with the channel name.\\

Replace \<PACKAGE\_NAME> with the package name.

To remove a package from a subchannel:

```sh theme={null}
conda repo remove <CHANNEL_NAME>/<SUBCHANNEL_NAME>::<PACKAGE_NAME>
```

Comments

Replace \<CHANNEL\_NAME> with the channel name.\\

Replace \<SUBCHANNEL\_NAME> with the subchannel name.\\

Replace \<PACKAGE\_NAME> with the package name.

## Related

* [Packages](https://anaconda.com/docs/psm-on-prem/6.8.0/user/package.md): Managing packages through the GUI
* [`upload` command reference](https://anaconda.com/docs/psm-on-prem/6.8.0/cli/commands/upload): Full options and flags
* [`download` command reference](https://anaconda.com/docs/psm-on-prem/6.8.0/cli/commands/download): Full options and flags
* [`copy` command reference](https://anaconda.com/docs/psm-on-prem/6.8.0/cli/commands/copy): Full options and flags
* [`move` command reference](https://anaconda.com/docs/psm-on-prem/6.8.0/cli/commands/move): Full options and flags
* [`remove` command reference](https://anaconda.com/docs/psm-on-prem/6.8.0/cli/commands/remove): Full options and flags
* [`search` command reference](https://anaconda.com/docs/psm-on-prem/6.8.0/cli/commands/search): Full options and flags
