jq. These recipes turn AgentEye’s observability data into something a terminal user or an AI coding agent (Claude Code, Cursor) can query and automate, without clicking through the dashboard.
The patterns below are copy-paste ready for the AgentEye CLI (agenteye). For installation, authentication, and the full option list see CLI; run agenteye -h or agenteye <command> -h for the built-in help.
Golden rules
- Global options go before the command.
agenteye --json sessionsis correct;agenteye sessions --jsonis not. The globals are--json,--base-url,--org,--token,--insecure/--secure,--timeout,--quiet,--no-color. - Pass
--jsonwhenever you parse output. Data goes to stdout as JSON; human status and errors go to stderr, so stdout stays clean to pipe intojq. - Branch on the exit code, not on stderr text:
0ok ·2bad arguments ·3cannot reach the dashboard ·4not logged in or expired ·5missing permission. - Discover with
-h. Every command documents its filters, value formats, and JSON shape.
One-time setup
Confirm auth before doing work
whoami never errors on a missing or expired session; it reports logged_in:false instead, so an agent can probe auth state safely. (It can still exit non-zero if no base URL is set or the dashboard is unreachable.)
Find failing or low-scoring sessions
evals, not sessions. --score KEY:MIN..MAX is repeatable and AND-combined; either bound is optional (..0.5 means ≤ 0.5, 0.9.. means ≥ 0.9). You can pass up to 20 score filters per request; more returns HTTP 400. sessions shares the --env, --status, --agent-id, --session-id, and time-range filters with evals, but has no --score.
Read one session end-to-end
There is no singlesession show command — combine the event trail with the session’s evaluation:
Fetch everything (pagination)
Results are newest-first and cursor-paginated.Slim the output with —fields
Restrict the keys (in both the table and--json) to reduce what an agent must read.
2) with the valid list, a cheap way to discover field names.
Discover valid filter values
Pick your org (multi-tenant)
If you belong to more than one org, choose the active tenant at login (it’s saved):--org exits non-zero and prints the orgs to choose from.
Provision an API key for the SDK/collector
Run a saved or ad-hoc query
Triage an incident non-interactively
Mutations auto-skip their confirmation prompt under--jsonor when stdin isn’t a TTY, so agents never hang; pass--yes/-yto skip it explicitly elsewhere.
Exit-code handling in a script
JSON output shapes
| Command | stdout JSON (with --json) |
|---|---|
whoami | {"logged_in": true, "id", "email", "is_instance_admin", "active_org", "permissions": [...], "memberships": [...]} or {"logged_in": false} |
orgs list | {"active_org", "orgs": [{"org_slug","org_name","permission_set","permissions"}]} |
events | {"events": [...], "next_cursor": <cursor or null>} |
evals | {"evaluations": [...], "next_cursor": <cursor or null>} |
sessions | {"sessions": [...], "next_cursor": <cursor or null>} |
errors | {"errors": [...], "next_cursor": <cursor or null>} |
list <kind> | {"kind", "values": [...]} |
keys list / keys create | {"keys": [...]} / {id, name, permissions, created_at, key} (key shown once) |
query run | {columns: [{name,type}], rows: [[...]], truncated, elapsed_ms} |
users list / settings list | {"users": [...]} / {"settings": [...]} |
alerts list / incidents list | {"alerts": [...]} / {"incidents": [...]} |
| create/update/delete (any) | the resource object, or {"deleted": true, "id"} for deletes |
failure (any, with --json) | {"error": "...", "exit_code": <n>, "status"?: <http>, "hint"?: "..."} on stdout |
- Each event item (
events):id, session_id, agent_id, event_type, ts, payload, environment. - Each evaluation item (
evals):id, session_id, agent_id, environment, status, scores, reasoning, summary, error, attempt_count, duration_ms, completed_at, created_at. - Each session item (
sessions):session_id, agent_id, environment, status, scores, event_count, started_at, last_event_at, first_event_id, last_event_id, latest_evaluation.
--fields accepts exactly its own item’s field names — the set differs between sessions and evals, so a name valid for one may be rejected by the other.
