Getting Started#

Let’s get set up with MCLI, the MosaicML command line interface (CLI) and SDK. Install MCLI via pip into your python3 environment:

pip install --upgrade mosaicml-cli

There are two options listed below for configuring an API key. To manage your account or create new keys, visit the MosaicML console.

CLI access#

This command will walk you through getting started and configuring mcli:

mcli init

You can also reset your API key through the command line at anytime by running:

mcli set api-key <new-value>

Access through environment variables#

The MOSAICML_API_KEY environment variable can also be used to configure access:

export MOSAICML_API_KEY=<value>

Note that the environment variable takes precedent over the api key set through the CLI

Advanced configuration#

CLI Autocomplete#

We support autocomplete tab completion in bash and zsh shells through argcomplete. To register tab completion:

eval "$(register-python-argcomplete mcli)"

Depending on your shell configuration, you may see an error, zsh: command not found: compdef. In that case, you need to run two commands before register-python-argcomplete:

autoload -Uz compinit
compinit
eval "$(register-python-argcomplete mcli)"

Other environment variables#

Below are all environment variables that can be used to configure MCLI. Most defaults can be left as is:

Variable

Default

Description

MCLI_CONFIG_DIR

~/.mosaic

Folder used to store MCLI configuration file

MCLI_CONFIG_PATH

~/.mosaic/mcli_config

File used to store MCLI configuration file

MCLI_TIMEOUT

10

Timeout (seconds) for queries against the MosaicML API

MOSAICML_API_KEY

Config set API key override