Skip to content

Logo Logo

Command-Line Interface Overview

Introduction

The Command-Line Interface (CLI) provides a powerful way to interact with Flywheel. This article gives an overview of the features of the Flywheel CLI along with some examples.

Instruction Steps

Download the Flywheel CLI

See our article to download and install the Flywheel CLI.

Command Description
batch Start or manage server batch jobs
bids Run the BIDS validator on a directory
See the BIDS import or BIDS export articles for more information. 
cp Copy a local file to a remote location, or vice-a-versa
deid Create and test de-identification template
download Download a remote file or container.
Learn more about running this command.
export Export BIDS data from Flywheel. Use the download command for other datatypes.
gear Gear commands (requires Docker).
See our gear documentation for more information on using this command.
help Help about any command
import Import data into Flywheel.
See the import dicom, import template, import folder , import PAR/REC, and import bruker articles for more information.
ingest Create and test de-identification template
See the ingest dicom, ingest folder, or ingest template articles for more information.
job Start or manage server jobs
login Login to a Flywheel instance
logout Delete your saved API key
ls Show remote files
status See your current login status
sync Sync files from Flywheel to storage
Learn more about the sync command here.
upload Upload a remote file
version Print CLI version

Getting Help

With any command, you can add -h or --help to get more information. For example, with the ls command we'll see in the following section:

Help

$ fw ls -h
Show remote files

Usage:
  fw ls [path] [flags]

Flags:
  -h, --help   help for ls
      --ids    Display database identifiers

We can start with fw ls. This lists the groups available to you and your current permission level.

ls

$ fw ls
admin neuroscience
admin clinical
admin psychology

Use ls again to show projects and sessions. For sessions, you can see the timestamp and subject code. In the example below, the last entry is an attachment on the project.

$ fw ls neuroscience
admin Amygdala Structure
admin Cerebellum Circuitry
$ fw ls "neuroscience/Cerebellum Circuitry"
admin May  7 08:42 ccirc_sub_1   ccirc_sub_1_ccirc_ses2_protB
admin Jan  7 17:30 ccirc_sub_1   ccirc_sub_1_ccirc_ses1_protA
# ...
admin Jun 14 16:52               InformedConsent_MRI.pdf

Note: double quotes are required when there are spaces in the pathname.

Learn About Using the Flywheel CLI

The following articles explain how to use the Flywheel CLI for common tasks: