{"id":9957,"library":"mosaicml-cli","title":"MosaicML CLI","description":"The `mosaicml-cli` provides a command-line interface for interacting with Databricks Mosaic AI training. It allows users to authenticate, manage runs, models, and clusters directly from their terminal. The current version is 0.8.3, and new versions are released periodically to align with updates to the Mosaic AI platform.","status":"active","version":"0.8.3","language":"en","source_language":"en","source_url":"https://github.com/mosaicml/mosaicml-cli","tags":["cli","mlops","cloud","databricks","machine-learning"],"install":[{"cmd":"pip install mosaicml-cli","lang":"bash","label":"Install current stable version"}],"dependencies":[{"reason":"Provides the underlying Python SDK functionality that the CLI interacts with.","package":"mosaicml","optional":false},{"reason":"CLI framework used to build the command-line interface.","package":"typer","optional":false},{"reason":"Used for rich text and beautiful output in the terminal.","package":"rich","optional":false}],"imports":[{"note":"This is the internal Typer application object for the CLI. End-users typically interact via the `mosaicml` command in the terminal, not by importing this library programmatically. For Python SDK functionality, install and use the `mosaicml` library (without '-cli').","symbol":"app","correct":"from mosaicml_cli.main import app"}],"quickstart":{"code":"mosaicml login\n# Follow the on-screen instructions to authenticate via a browser.\n\n# List available models (requires authentication)\nmosaicml list models\n\n# Example of running a training job (requires a config.yaml file and an authenticated session)\n# This command assumes you have a 'config.yaml' file in your current directory.\n# For a real quickstart, replace 'path/to/my_config.yaml' with your actual path.\n# If you don't have one, just run 'mosaicml list models' as a basic check.\n# mosaicml run path/to/my_config.yaml","lang":"bash","description":"The most crucial step is to log in using `mosaicml login`. This authenticates your CLI session with the Mosaic AI platform. After successful login, you can execute various commands, such as listing models or initiating training runs."},"warnings":[{"fix":"If you intend to write Python code, install `pip install mosaicml`. If you need the command-line tool, use `pip install mosaicml-cli`.","message":"Common confusion between `mosaicml-cli` and `mosaicml` library. `mosaicml-cli` is solely for command-line interaction. For programmatic Python usage (e.g., in a script or application), you should install and import the `mosaicml` library.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Run `mosaicml login` to authenticate your session, or ensure `MOSAICML_API_KEY` and `MOSAICML_API_URL` environment variables are set.","message":"All commands interacting with the Mosaic AI platform require prior authentication. Failure to authenticate will result in 'Not logged in' errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always refer to the official documentation or the `mosaicml <command> --help` output for the most up-to-date syntax. Keep your CLI updated with `pip install --upgrade mosaicml-cli`.","message":"As a relatively new CLI, command names, arguments, and configuration schemas may evolve in minor or patch releases, especially as the underlying Mosaic AI platform updates.","severity":"breaking","affected_versions":"0.x.x versions"},{"fix":"Ensure your Python environment is at least 3.11. Consider using `pyenv` or `conda` to manage multiple Python versions.","message":"`mosaicml-cli` requires Python 3.11 or higher. Using an older Python version will lead to installation failures or runtime errors.","severity":"gotcha","affected_versions":"<=0.8.3"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure `pip install mosaicml-cli` completed successfully. Verify that your Python's `Scripts` or `bin` directory (where CLI tools are installed) is included in your system's PATH environment variable.","cause":"The `mosaicml` command-line entry point is not in your system's PATH, or the installation failed.","error":"'mosaicml' is not recognized as an internal or external command, operable program or batch file."},{"fix":"Run `mosaicml login` and follow the browser-based authentication flow. Alternatively, set the `MOSAICML_API_KEY` and `MOSAICML_API_URL` environment variables manually.","cause":"The CLI is not authenticated with the Mosaic AI platform.","error":"Error: Not logged in. Please run 'mosaicml login'."},{"fix":"Upgrade your Python installation to version 3.11 or newer. If you have multiple Python versions, switch to an environment with Python 3.11+ before installing/running `mosaicml-cli`.","cause":"Your active Python environment does not meet the minimum version requirement for `mosaicml-cli`.","error":"The installed Python version is X.Y.Z, but mosaicml-cli requires Python >= 3.11."},{"fix":"Provide the correct path to your configuration file (e.g., `mosaicml run ./my_config.yaml`) or ensure the file exists at the specified location. Consult the documentation for examples of `config.yaml`.","cause":"Commands like `mosaicml run` require a YAML configuration file to define the training job.","error":"Error: Could not find configuration file at 'path/to/my_config.yaml'"}]}