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).
Let the agent configure CI
An AI coding agent can set up Monito GitHub Actions from start to finish after you complete the two one-time browser sign-ins:
Then prompt the agent with the repository and Monito project context:
Set up Monito GitHub Actions for this repository using the Storefront project. Run the plan first, then apply and verify it. Do not expose credentials.
For a blocking check after a successful production deployment, the agent should use:
plan is read-only. apply writes the workflow and registers the exact project, repository ID, owner ID, workflow ref, triggers, and environment that Monito may trust. The generated job exchanges GitHub's short-lived OIDC token in memory; it does not create, print, or store a Monito API key. --remote-auth runs an auth-only workflow, waits for its exact correlated result, and spends no Monito credits. The commands are idempotent, return versioned JSON, skip fork pull requests, and provide structured blockers and next actions.
After static verification, the agent can commit and push .github/workflows/monito.yml through the repository's normal Git workflow. The Monito CLI never commits or pushes code itself.
Do not use monito auth create-key --json for agent-driven CI setup because that lower-level command intentionally returns the new key. OIDC is the secretless path. Use --auth api-key only when the user explicitly requires compatibility with a runner that cannot use GitHub OIDC.
Once the generated workflow is on the repository's default branch, the agent can optionally dispatch a real run:
This spends Monito credits, so the CLI requires explicit confirmation.
CLI 4 retains --mode github-actions and --mode deploy-webhook as deprecated aliases. Prefer --execution plus repeatable --trigger flags in agent automation.
To remove the integration, plan cleanup separately and inspect the exact operations before applying:
Cleanup preserves unknown keys for manual review. It must run only after a replacement authentication path has passed --remote-auth and the user has approved removal.
Authentication
For normal CLI use, authenticate once in the browser:
For an existing headless environment, you can instead set the MONITO_TOKEN environment variable:
Or retrieve a token programmatically:
Structured Output
Use --json to get machine-readable output:
Parsing with jq
Workflow Example
A typical AI agent workflow:
Claude Code Integration
When using Monito CLI with Claude Code, the AI agent can:
- Run
monito ci plan/apply/verify --auth oidcto configure CI without creating credentials - Run
monito project list --jsonto discover available projects - Run
monito scenario run <id> --jsonto execute tests - Parse the JSON output to understand test results
- Use
monito session events <id> --jsonto debug failures
The --json flag ensures all output is parseable, and exit codes indicate pass/fail status.