> ## Documentation Index
> Fetch the complete documentation index at: https://monid.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> The Monid CLI lets you discover, inspect, and run data endpoints from the command line.

The Monid CLI lets you discover, inspect, and run data endpoints from the command line.

## Installation

```bash theme={null}
curl -fsSL https://monid.ai/install.sh | bash
```

Verify:

```bash theme={null}
monid --version
```

## Setup

### 1. Get an API Key

Go to [https://app.monid.ai](https://app.monid.ai) to create an account if you don't have one. Then go to [https://app.monid.ai/access/api-keys](https://app.monid.ai/access/api-keys) to create an API key. **Copy the key — it is only shown once.**

### 2. Add the Key

```bash theme={null}
monid keys add --label main --key <your-api-key>
```

The first key you add is automatically set as the active key.

### 3. Switch Active Key

If you have multiple keys, switch between them:

```bash theme={null}
monid keys activate --label <name>
```

## Example Workflow

```bash theme={null}
# 1. Discover endpoints for your data need
monid discover -q "twitter posts about AI"

# 2. Inspect an endpoint to see its input schema and pricing
monid inspect -p apify -e /apidojo/tweet-scraper

# 3. Run the endpoint
monid run -p apify -e /apidojo/tweet-scraper \
  -i '{"searchTerms":["AI"],"maxItems":10}'

# 4. Get the results
monid runs get -r <run-id> -o tweets.json
```

## Global Flags

All data commands support:

| Flag         | Description                                                                                                          |
| ------------ | -------------------------------------------------------------------------------------------------------------------- |
| `-j, --json` | Output raw JSON instead of formatted text. Suppresses spinners and colors. Useful for piping into `jq` or scripting. |
| `--help`     | Show help text for the command                                                                                       |

## Polling Strategies

Endpoint execution times vary widely depending on the endpoint and data volume. The recommended approach is to run without `--wait` and poll separately:

```bash theme={null}
# Start the run (returns immediately with a run ID)
monid run -p apify -e /apidojo/tweet-scraper -i '{"searchTerms":["AI"]}'
# → Run ID: 01HXYZ...

# Poll for results
monid runs get -r 01HXYZ... -o results.json
```

For blocking use cases, you can use `--wait` which polls with automatic exponential backoff until the run completes:

```bash theme={null}
monid run -p apify -e /apidojo/tweet-scraper \
  -i '{"searchTerms":["AI"]}' --wait -o results.json
```

## Environment Variables

| Variable             | Description                    |
| -------------------- | ------------------------------ |
| `MONID_API_BASE_URL` | Override the API base URL      |
| `XDG_CONFIG_HOME`    | Override config directory base |
| `NO_COLOR`           | Disable ANSI color codes       |

## Commands

### Endpoints

| Command                           | Description               |
| --------------------------------- | ------------------------- |
| [`monid discover`](/cli/discover) | Search for data endpoints |
| [`monid inspect`](/cli/inspect)   | Get full endpoint details |
| [`monid run`](/cli/run)           | Execute a data endpoint   |

### Runs

| Command                             | Description                    |
| ----------------------------------- | ------------------------------ |
| [`monid runs list`](/cli/runs/list) | List recent runs               |
| [`monid runs get`](/cli/runs/get)   | Get a run's status and results |
| [`monid runs stop`](/cli/runs/stop) | Stop a queued or running run   |

### Keys & Access

| Command                                     | Description                  |
| ------------------------------------------- | ---------------------------- |
| [`monid keys list`](/cli/keys/list)         | List locally stored API keys |
| [`monid keys add`](/cli/keys/add)           | Add an API key               |
| [`monid keys activate`](/cli/keys/activate) | Switch the active API key    |
| [`monid keys remove`](/cli/keys/remove)     | Remove an API key            |

### Examples

See [Examples](/cli/examples) for complete end-to-end workflows.
