---
title: "Using the mabl CLI"
description: "This article is for new users who are unfamiliar with command-line tools. Follow the commands outlined in this article to log in to the mabl CLI, get..."
last_updated: "2026-06-19"
source_url: "https://help.mabl.com/hc/en-us/articles/17782132680212-Using-the-mabl-CLI"
---

# Using the mabl CLI

> For the full index of agent-friendly pages, see [llms.txt](/llms.txt).

This article is for new users who are unfamiliar with command-line tools. Follow the commands outlined in this article to log in to the mabl CLI, get more information on mabl CLI commands, and understand how different commands work.

## Authentication

To use the mabl CLI on your local machine, run the following command:

``` language-lang-shell
mabl auth login --auto
```

This command prompts the mabl CLI to open the mabl login page in a browser window. Log into mabl using your usual method: username and password, Google auth, or SSO. The mabl CLI automatically copies the authorization code from the browser window and pastes it into the terminal window to finish logging in.

### Authenticating with an API key

If you are incorporating the mabl CLI into a [script](https://help.mabl.com/hc/en-us/articles/17781003105812), you can authenticate with an [API key](https://help.mabl.com/hc/en-us/articles/17776006239764):

``` language-lang-shell
mabl auth activate-key {api-key}
```

## Exploring the mabl CLI

The mabl CLI includes a range of commands for integrating mabl tests into your workflow. To learn more about the different commands available in the mabl CLI, run the following command:

``` language-lang-shell
mabl -h
```

The `-h` or `--help` option can be added to any mabl CLI command to get more information. For example, to learn more about commands for managing environments, run the following command:

``` language-lang-shell
mabl environments -h
```

To learn more about the available options for a subcommand, such as `mabl environments update`, add the `-h` option again. For example:

``` language-lang-shell
mabl environments update -h
```

## Components of a mabl CLI command

Depending on the command that you run, you may need to include an argument or options.

### Arguments

Some mabl CLI commands require arguments, which are values passed into the command. For example, to create a branch from the mabl CLI, you need to provide the name of the new branch as an argument:

``` language-lang-shell
mabl branches create {branch-name}
```

### Options

Options, also known as "flags", modify the behavior of a command. Options are preceded with a hyphen or double-hyphen. For example, to return a list of DataTables from your workspace in JSON format, use the `mabl tests list` command with the `--output` option:

``` language-lang-shell
mabl datatables list --output json
```

### mabl resource IDs

Many commands in the mabl CLI require a mabl resource ID as an argument or optional argument. For example, to trigger an ad hoc local run, you need to provide a test ID for the option `--id`:

``` language-lang-shell
mabl tests run --id {test-id}
```

You can obtain mabl resource IDs by running the `list` command. For example, run the following command to obtain mabl resource IDs for tests in your workspace:

``` language-lang-shell
mabl tests list
```

> **Note:**
> For more information on the different ways to obtain mabl resource IDs for different mabl components, including tests, plans, DataTables, and environments, check out [this article](https://help.mabl.com/hc/en-us/articles/17782745983636).

## Next steps

Now that you are familiar with the basics, try triggering an [ad hoc test run](./triggering-tests-from-the-mabl-cli.md) from the mabl CLI!
