Skip to content

Downloading Files using the CLI

Sessions, acquisitions, and files can be downloaded using the fw download command.

Additional Download Options:


fw download [-h] [--config-file CONFIG_FILE | --no-config] [-y] [--ca-certs CA_CERTS] [--timezone TIMEZONE] [--debug | --quiet] [-o [OUTPUT]]  

Required Flags

Required Argument Description
source-path The location of the file on your Flywheel instance. For example [fw://group/project/subject/acquisition/attachments]

Optional Flags

For a full, up-to-date list of options, run the following from your command line:

fw download --help

Below is a list of commonly used options.

Optional flag Description
-e, --exclude file type Download everything but these file types.
Learn more about file types in Flywheel
-y, --yes Assume the answer is yes to all prompts
-h, --help Displays help for download
--include file type Download only these file types.
Learn more about file types in Flywheel
--output file name Name of the folder where the data is downloaded
-p PREFIX, --prefix PREFIX Prefix for downloaded directory structure
-i INCLUDE, --include INCLUDE Download only these file types (ex. DICOM or NIfTI)
-e EXCLUDE, --exclude EXCLUDE Download everything but these file types (ex. DICOM or NIfTI)


Below is an example of how to download a particular subject:

  1. Download the Flywheel CLI, and sign in using your API key. Once signed in, the following message should appear:
C02W39YBHTD6:~ AvaAnderson$ fw login***********pf
You are now logged in as Ava Anderson!
  1. Now you can navigate to the files you wish to download. In this example, we're navigating to the subjects in the AnxietyStudy project:
C02W39YBHTD6:~ AvaAnderson$ fw ls Psychology/AnxietyStudy
admin **s13**
admin **s3**
admin **s5**
admin **s11**
admin **s14**
admin **s15**
admin **s12**
admin Dec5 17:49files/license.txt 

Tip - If a project or subject's name includes spaces, use quotes around the name. For example: Psychology/"An example study"

  1. To download one of those subjects:
C02W39YBHTD6:~ AvaAnderson$ fw download Psychology/AnxietyStudy/s3

This download will be about 218 MB comprising 39 files.

Continue? (yes/no): yes
Wrote 218 MB to s3.tar