Skip to content

Command Line Examples

The Cirro command-line interface (CLI) provides an easy way to access your Cirro data from the command prompt. The most common uses of the CLI are to upload new datasets or to download either partial or entire datasets. To get started with the CLI, first learn about installing the Cirro client and then see the examples below.

Quick Hint: Uploading and Downloading Large Files from the Command Line

# Install the CLI
pip install cirro

# Upload
cirro upload -i

# or Download
cirro download -i

Automated Uploading Datasets

To automate the process of dataset upload, cirro can be used in non-interactive mode. To use this method, run:

cirro upload [OPTIONS]
with the following options:
[OPTIONS]:
  --name TEXT             Name of the dataset
  --description TEXT      Description of the dataset (optional)
  --project TEXT          Name or ID of the project
  --process TEXT          Name or ID of the ingest process (indicating the dataset type)
  --data-directory TEXT   Directory you wish to upload
  -i, --interactive       Gather arguments interactively
  --help                  Show this message and exit.

Interactive Uploading Datasets

To start the interactive upload process, run:

cirro upload --interactive
You will be prompted to enter the following information. Follow the directions in the command line and hit enter after each of the following:

  1. Select the project which the new dataset should be uploaded to using the arrow keys. E.g. Test Project
  2. Enter the path to the directory on your filesystem which should be uploaded. E.g. /shared/biodata/test
  3. Confirm the number and size of files to upload. E.g. Yes
  4. Select the dataset type using the arrow keys. E.g. RNAseq (FASTQ)
  5. Enter the dataset name. E.g. Test Dataset
  6. Enter the dataset description (optional). E.g. Test data for practice

After providing all of the required information, the files will be uploaded into the new dataset. Once the upload process is complete, the dataset will become visible in Cirro.

Automated Downloading Datasets

To automate the process of dataset download, cirro can be used in non-interactive mode. To use this method, run the command:

cirro download [OPTIONS]
with the following options:
[OPTIONS]:
  --project TEXT         Name or ID of the project
  --dataset TEXT         ID of the dataset
  --data-directory TEXT  Directory to store the files
  -i, --interactive      Gather arguments interactively
  --help                 Show this message and exit.

Interactive Downloading Datasets

To interactively download a dataset (or part of a dataset) from Cirro to your local hard drive, run:

cirro download --interactive

You will be prompted to enter the following information. Follow the directions in the command line and hit enter after each of the following:

  1. Select the project which contains the dataset of interest
  2. Select the dataset to download. Here you can paste your full dataset name and ID and hit enter. You can also start typing your dataset name, then press TAB and once you see your dataset, you can use the arrows keys to walk through the options and hit enter to select a dataset. Or pressing TAB immediately will provide a list of all available options, and you can arrow down to your selection and hit enter.
  3. Edit the local folder to use as the destination of the download if necessary
  4. Select if you want to download the entire dataset, only some of the files by choosing from a list of file names, or only some of the files by providing a glob naming pattern (e.g. *.fastq.gz)
    • If you choose to download some of the files by selecting them, use the up/down arrows keys to walk through the list and hit space to select a file and space again to deselect it. If you want to select all the files, you can hit a. If it is easier, you can also select the files you don't want to download and then hit i to switch all the selected and unselected files. When you are happy with your selection, hit enter.
    • If you choose to download some of the files using a pattern, type the glob naming pattern and hit enter. Then you will see a list of the files you've selected and you can choose y to continue downloading or n to go back and re-enter your naming pattern.

All files from the dataset will be downloaded to a folder named data/ in your selected destination.

Listing Datasets in a Project

To list all the datasets available in a project (often used before downloading files), you can run:

cirro list-datasets [OPTIONS]
with the following options:
[OPTIONS]:
  --project TEXT         ID of the project
  -i, --interactive      Gather arguments interactively
  --help                 Show this message and exit.