MD.ai

Install the CLI

Install the MD.ai Annotator command line interface

The mdai CLI scripts common project tasks: creating projects and datasets, uploading large datasets, deleting DICOM resources, managing users and assignments, working with models, and running de-identification. It is the recommended way to upload datasets larger than about 100 GB.

Download

The latest version is v0.29.0. Download the zip file for your platform:

Only 64-bit platforms are supported. The Linux builds are statically linked, so they run on any distribution.

Add mdai to your PATH

Unzip the package and move the mdai binary to a directory on your PATH, so you can run it from anywhere. For example, on macOS or Linux:

unzip mdai_cli_*.zip
sudo mv mdai /usr/local/bin/

On macOS, if you downloaded the zip in a browser, remove the quarantine flag once. Otherwise macOS refuses to run the binary because it can't verify the developer:

xattr -d com.apple.quarantine /usr/local/bin/mdai

On Windows, move mdai.exe to a folder of your choice and add that folder to the Path environment variable (Settings > System > About > Advanced system settings > Environment Variables).

Verify the installation

Open a new terminal and run mdai. You should see:

$ mdai
MDAI CLI is a command line interface to the MD.ai Annotator API.

Usage: mdai <COMMAND>

Commands:
  version  Get package version
  config   View or set configuration variables
  project  Project operations
  dataset  Dataset operations
  model    Model operations
  deid     De-ID operations
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

mdai version prints the installed version and the latest available version.

If you get command not found (exit code 127), the directory containing mdai is not on your PATH.

Upgrading from v0.28 and earlier

From v0.29.0, the CLI is a native application, rewritten in Rust. Commands, options, --json output and your configuration are unchanged. What's different:

  • Commands exit with status 1 when they fail.
  • Custom CA certificates work differently. See Custom CA certificates.
  • Windows: v0.28 and earlier can't replace their own .exe when auto-upgrading, and stop with EPERM: operation not permitted. Download v0.29.0 manually. From v0.29.0, the CLI uses a new updater that supports Windows.
  • macOS on Apple silicon: earlier versions ran under Rosetta, and auto-upgrade keeps the Intel build. Download the Apple silicon build for a native one.

Next steps

Configure the CLI with your domain and access token, then see the command reference.

On this page