ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Getting Started with Meiro Integrations Command-Line Tool

MI CLI is a command-line tool that gives you fast, read-only access to data in your Meiro Integrations environment.

It is designed for users who need to inspect data, validate setup, troubleshoot issues, or run quick checks without using the web interface.

Because the tool is read-only for MI resources, it is safe for analysis work. It does not create, update, or delete MI resources.


Who Is MI CLI For?

MI CLI can be useful for:

  • Meiro analysts

  • Technical support teams

  • QA engineers

  • Consultants

  • Implementation teams

  • Developers

  • Advanced platform users

You do not need to be a developer to use it, but basic terminal knowledge is helpful.


Why Use MI CLI?

Using the CLI can save time when you need quick answers.

Common use cases

  • List available components

  • Inspect workspaces and configurations

  • Search configuration settings for specific fields or logic

  • Check workspace and configuration run history

  • Review execution logs

  • Download sandbox input/output archives

  • Compare multiple MI environments

  • Troubleshoot authentication issues quickly


Before You Start

Prepare the following:

  • Access to the MI CLI repository

  • Your MI environment URL
    Example: https://mi-demo.example.com

  • Your login email and password

  • Terminal access on macOS, Linux, or Windows (WSL recommended)


Install MI CLI

Option A: One-Liner (Recommended)

Requires GitHub CLI (gh) installed.

gh api repos/meiroio/mi-cli/contents/setup-cli.sh -H "Accept: application/vnd.github.raw" | bash
Update
gh api repos/meiroio/mi-cli/contents/setup-cli.sh -H "Accept: application/vnd.github.raw" | bash -s -- update
Uninstall
gh api repos/meiroio/mi-cli/contents/setup-cli.sh -H "Accept: application/vnd.github.raw" | bash -s -- uninstall

Option B: Manual Install with uv

uv tool install "git+https://github.com/meiroio/mi-cli.git"
SSH Alternative
uv tool install "git+ssh://git@github.com/meiroio/mi-cli.git"
Update
uv tool install --force "git+https://github.com/meiroio/mi-cli.git"
Uninstall
uv tool uninstall mi-cli

Option C: Clone Repository and Run

git clone git@github.com:meiroio/mi-cli.git ~/meiro-mi-cli
bash ~/meiro-mi-cli/setup-cli.sh
Update
cd ~/meiro-mi-cli && git pull && bash setup-cli.sh update

If the Command Is Not Found

If your terminal does not recognize mi, add the local tools path:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

First-Time Setup

Setup usually takes only a few minutes.

Step 1: Save Your Environment

This creates a reusable alias for your MI environment.

mi instance set demo \
  --url https://mi-demo.example.com \
  --email analyst@company.com \
  --password 'secret'

In this example

  • demo = saved connection name

  • url = your MI environment

  • email/password = your login credentials

You can choose any alias name such as:

  • prod

  • staging

  • client-a


Step 2: Log In

mi auth login --instance demod

This creates an authenticated session.


Step 3: Verify Access

mi auth status --instance demo --check

Use this command to confirm authentication is working correctly.


Step 4: Run Your First Checks

mi me --instance demo
mi components list --instance demo --limit 50

These commands confirm identity and basic API access.


Working with Multiple Environments

Many teams use several environments such as production, staging, or testing.

View Saved Environments

mi instance list

Switch Active Environment

mi instance use demo

Show Current Configuration

mi instance show --instance demo

How Commands Work

MI CLI commands follow a simple structure:

mi <area> <action> [options]
Examples
mi workspaces list --instance demo --limit 50
mi configurations get --instance demo --workspace-id 123 --configuration-id 777
mi jobs workspace logs-list --instance demo --workspace-id 123 --job-id 456 --level error --limit 100
Think of it like this
  • area = what you want to work with

  • action = what you want to do


Use Cases

These examples show how you can use the MI CLI in real situations.
They are based on common analyst and operational tasks where using the CLI is faster than the UI and helps with troubleshooting.

You don’t need to know all commands — just find the situation that matches what you are trying to solve.


Check if the System Is Healthy

When to use:

When someone asks: “Is MI working correctly right now?”

What does this help you check:

  • Are you properly logged in?

  • Is the system running?

  • Are recent jobs finishing successfully?

What to run:

mi auth status --instance demo --check
mi system info --instance demo
mi workspaces list --instance demo --limit 50
mi workspaces last-jobs --instance demo

What you get:

A quick overview of system health and recent activity. If something is wrong, you will usually spot it here first.


Investigate a Failed Workspace Run

When to use:

When a scheduled run fails and you need to find out where the problem happened.

What this helps you answer:

  • Which part of the workflow failed?

  • Was it one configuration or multiple?

What to run:

mi jobs workspace get --instance demo --workspace-id 123 --job-id 456
mi jobs workspace history-list --instance demo --workspace-id 123 --job-id 456 --limit 20
mi jobs workspace configuration-jobs-list --instance demo --workspace-id 123 --job-id 456 --limit 50

What you get:

A breakdown of the run, including all steps. This helps you quickly identify the failing part.


Read the Exact Error Message

When to use:

After you find a failed configuration and need to understand why it failed.

What this helps you answer:

  • What exactly went wrong?

  • Is it a data issue, script error, or configuration problem?

What to run:

mi jobs configuration logs-list --instance demo --workspace-id 123 --configuration-id 777 --job-id 456 --level error --limit 100
mi jobs configuration log-get --instance demo --workspace-id 123 --configuration-id 777 --job-id 456 --log-id 789

What you get:

The exact error message or traceback needed for root-cause analysis.


Check if a Recent Change Caused the Issue

When to use:

When something worked before and suddenly started failing.

What this helps you answer:

  • What changed recently?

  • Did a configuration update break something?

What to run:

mi configurations history-list --instance demo --workspace-id 123 --configuration-id 777 --limit 20
mi configurations history-get --instance demo --workspace-id 123 --configuration-id 777 --history-id 55
mi jobs configuration list --instance demo --workspace-id 123 --configuration-id 777 --limit 20 --order-by created --order-dir desc

What you get:

A timeline of changes and runs, so you can match failures with recent updates.


Find Where a Field or Logic Is Used

When to use:

Before changing a field name, schema, or logic.

What this helps you avoid:

  • Breaking other configurations

  • Missing hidden dependencies

What to run:

mi configurations settings-search --instance demo --search-text event_timestamp --limit 100

What you get:

A list of configurations where the field or keyword is used.


Check What Script Is Actually Running

When to use:

When a configuration behaves differently than expected.

What this helps you answer:

  • What code is actually executed?

  • Is the script correct?

What to run:

mi configurations script --instance demo --workspace-id 123 --configuration-id 777
mi configurations get --instance demo --workspace-id 123 --configuration-id 777

What you get:

The exact script and configuration settings used at runtime.


Check Real Input and Output Data

When to use:

  • Missing fields

  • Wrong formats

  • Unexpected data

What to run:

mi sandbox input-preview --instance demo --workspace-id 123 --configuration-id 777 --limit 5
mi sandbox input-preview-get --instance demo --workspace-id 123 --configuration-id 777 --preview-id 1
mi sandbox output-preview --instance demo --workspace-id 123 --configuration-id 777 --limit 5
mi sandbox output-preview-get --instance demo --workspace-id 123 --configuration-id 777 --preview-id 1

What you get:

A preview of real data being processed, so you can verify assumptions quickly.


Download Full Data for Deeper Analysis

When to use:

When previews are not enough and you need full datasets.

What to run:

mi sandbox pull --instance demo --workspace-id 123 --configuration-id 777 --kind input --output ./sandbox-input.zip
mi sandbox pull --instance demo --workspace-id 123 --configuration-id 777 --kind output --output ./sandbox-output.zip

What you get:

Complete input/output files that you can analyze locally or share with others.


Compare Staging vs Production

When to use:

When something works in one environment but not in another.

What to run:

mi instance use staging
mi workspaces last-jobs

mi instance use prod
mi workspaces last-jobs

What you get:

A quick comparison of behavior across environments using the same commands.


Access Advanced Endpoints

When to use:

When you need data that is not yet covered by standard CLI commands.

What to run:

mi api get --instance demo --path /workspaces/123/configurations/777/history --query limit=20 --query offset=0

What you get:

Direct access to API data in a safe, read-only way — useful for advanced troubleshooting.


Main Command Groups

MI CLI commands are organized into groups based on what you want to inspect.

Command Group Purpose
instance Manage saved environments
auth Login and token handling
me Show current authenticated user
system Show instance system info
components List or inspect components
workspaces Workspace listing and history
configurations Configuration details, script extraction, history
jobs workspace Workspace runs, history, logs
jobs configuration Configuration runs, history, logs
sandbox Data previews and downloads
api get Direct GET endpoint access

Important Things to Know

  1. Read-Only by Design: MI resource operations in this CLI are read-only. Authentication endpoints are used only for login and session handling. 
  2. Automatic Re-Authentication: If your session expires, the tool can automatically attempt:
      1. Token refresh
      2. Login using stored password
  3. Saved Configuration Location: Your saved environments are typically stored in:~/.config/cdp-cli/instances.json

  4. POC Security Note: Current POC behavior stores instance passwords in plain text in local config. Use only in trusted internal environments until secret storage is introduced. 
  5. Different ID Types

    Most MI IDs used by commands are numeric:

    • Workspace IDs

    • Configuration IDs

    • Job IDs

    • History IDs

    • Log IDs

    • Preview IDs


Troubleshooting

mi: command not found

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Environment Not Found

mi instance set demo --url https://mi-demo.example.com --email analyst@company.com --password 'secret'

Token Expired

mi auth refresh --instance demo
mi auth login --instance demo

Unexpected Errors

Check:

  • Correct environment is selected

  • Valid login credentials are used

  • Correct IDs are provided

  • Access permissions

  • Network connectivity


Getting Help

Show All Commands

mi --help

Show Help for a Specific Area

mi workspaces --help
mi jobs workspace --help

Best Practices

  • Save separate aliases for each environment

  • Use clear names like prod, stage, demo

  • Verify environment before running checks

  • Start with list/get commands before deep log analysis

  • Use --limit to keep responses manageable

  • Keep credentials secure and rotate them regularly


Summary

MI CLI is a fast and safe way to inspect your Meiro MI environment from the terminal.

It is especially useful for analysts, support, QA, and implementation teams who need quick operational answers without using the UI.