Skip to main content
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.
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
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.
monocle studio traces
You can filter by service name or trace ID, and control the output format.
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.
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.
monocle studio errors
monocle studio errors --trace-id abc123

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
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.