Documentation

Monocle Studio

CLI Commands

Query traces, logs, and errors from Monocle Studio directly in your terminal

Monocle Studio exposes CLI commands to query your local telemetry data without opening the browser. Useful for quick checks, scripting, or piping data into other tools.

These commands are also great for AI coding agents. Instead of copy-pasting logs from your terminal into Claude or Codex, your agent can call monocle studio errors or monocle studio traces directly and get full context on its own.

Dev

Start the local Studio server. This is the main entry point for Monocle Studio.

Terminal
monocle studio dev
OptionDefaultDescription
--port4200Port for the Studio UI and API
--host0.0.0.0Host to bind to
--openOpen browser automatically
--cleanClear all stored data before starting
--db-pathCustom path for the DuckDB database
Terminal
monocle studio dev --port 3000 --open
monocle studio dev --clean              # Fresh start, no past data

Traces

Fetch recent traces from Studio. Each trace shows the HTTP method, path, status code, duration, and service name.

Terminal
monocle studio traces

You can filter by service name or trace ID, and control the output format.

Terminal
monocle studio traces --service my-api --format json
monocle studio traces --trace-id abc123 --limit 10

Logs

Fetch recent logs with optional severity and search filters.

Terminal
monocle studio logs
monocle studio logs --severity error
monocle studio logs --search "payment failed" --limit 100

Errors

Fetch recent exceptions with type, message, and stack trace preview.

Terminal
monocle studio errors
monocle studio errors --trace-id abc123

Install agent instructions

Append a managed Monocle Studio block to AGENTS.md or CLAUDE.md so your agents know about Monocle Studio and how to use it.

Terminal
monocle studio install-agents

The command prompts for the target file, appends the block at the end, and updates only that managed block on later runs.

Output formats

The traces, logs, and errors commands support three output formats via the --format flag.

FormatDescription
prettyHuman-readable with colors and indentation (default)
shortOne line per entry, compact
jsonRaw JSON, useful for piping to jq or other tools
Terminal
monocle studio traces --format short
monocle studio logs --format json | jq '.[] | .body'

Common options

The traces, logs, and errors commands share these options.

OptionDefaultDescription
-p, --port4200Studio server port
-f, --formatprettyOutput format: pretty, json, short
-n, --limit25Number of entries to fetch
--trace-idFilter by trace ID

Make sure Monocle Studio is running (monocle studio dev) before using the query commands. They connect to the local Studio server over HTTP.

Search documentation

Search pages and sections of the Monocle documentation