CLI

Monte Carlo's CLI. Reference Guide

This guide explains the basic usage of Monte Carlo's CLI.

You can find the CLI reference guide (documentation on all commands, options, and arguments) here.

Requirements

The CLI requires Python 3.10 or greater.

Installing or updating the CLI

To install or update the CLI, please run:

pip install -U montecarlodata

Then, verify the installation using:

montecarlo --version

Setting up the CLI

To configure your CLI, please run:

montecarlo configure

You will be prompted to choose an authentication type β€” API key or OAuth β€” and then to enter the corresponding credentials. See API Authentication for how to create each type of credential.

❗️

Careful!

You are only able to see the secret (API key secret or OAuth client secret) once! Save it in a safe place.

Configure with an API key

To skip the prompt and configure an API key non-interactively, pass --api-key:

montecarlo configure --api-key --mcd-id <KEY_ID> --mcd-token <SECRET>

You can create an API key from the API settings page.

Configure with OAuth

To configure OAuth client credentials, pass --oauth. In addition to the client ID and secret, OAuth requires your deployment's instance ID (e.g. us1, eu1), shown under Account Information β†’ Instance ID in the app:

montecarlo configure --oauth \
  --mcd-oauth-client-id <CLIENT_ID> \
  --mcd-oauth-client-secret <CLIENT_SECRET> \
  --mcd-instance-id <INSTANCE_ID>

Omit the flags to be prompted for each value. The CLI handles the OAuth token exchange for you on each call; there is nothing else to configure.

After configuring you can validate your connection with:

montecarlo validate

Documentation

Documentation for commands, options, and arguments can be found here.

Otherwise, to get high-level help, please run:

montecarlo --help

Similarly, you can get help for a specific set of commands:

montecarlo integrations --help

To retrieve documentation (help text) on all commands, subcommands and options:

montecarlo help

As an example, this is how you would list all active integrations:

montecarlo integrations list

See here for additional details and examples.


Did this page help you?