Monito CLI

AI Agent Usage

Use the Monito CLI with AI agents like Claude Code, GPT, and custom scripts.

Overview

The Monito CLI is designed for AI agent consumption. Every command supports --json for structured output, and data is cleanly separated from human text (stdout vs stderr).

Authentication

Set the MONITO_TOKEN environment variable:

export MONITO_TOKEN=$(monito-cli auth token)

Or retrieve a token programmatically:

TOKEN=$(monito-cli auth token)

Structured Output

Use --json to get machine-readable output:

# List projects
monito-cli project list --json
 
# Get run results
monito-cli run view <id> --json
 
# Get session events
monito-cli session events <id> --type network --json

Parsing with jq

# Get project IDs
monito-cli project list --json | jq '.projects[].id'
 
# Get failed runs
monito-cli run list --json | jq '.runs[] | select(.status == "failed")'
 
# Get bug report titles from a session
monito-cli session view <id> --json | jq '.bugReports[].ticketTitle'

Workflow Example

A typical AI agent workflow:

# 1. List projects
monito-cli project list --json
 
# 2. Run all scenarios for a project
monito-cli project run <project-id> --json
 
# 3. Check results
monito-cli run view <run-id> --json
 
# 4. If failed, inspect the debug session
monito-cli session view <session-id> --json
 
# 5. Get network events for debugging
monito-cli session events <session-id> --type network --json

Claude Code Integration

When using Monito CLI with Claude Code, the AI agent can:

  1. Run monito-cli project list --json to discover available projects
  2. Run monito-cli scenario run <id> --json to execute tests
  3. Parse the JSON output to understand test results
  4. Use monito-cli session events <id> --json to debug failures

The --json flag ensures all output is parseable, and exit codes indicate pass/fail status.

On this page