Logfire Read Skill
Use this skill to read Logfire records with JSONL output using the repo’s reader utilities.
Quick Start
- Load
.envfrom the repo root:
sh1set -a 2. ./.env 3set +a
- Run the JSONL reader:
sh1python scripts/logfire-fetch.py
Or use the bundled script:
sh1./.codex/skills/logfire-read/scripts/read_logs.sh --message-like "Processing failed" --limit 10
Agent-Friendly CLI
Use the agent helper for targeted queries:
sh1python scripts/logfire-read-agent.py --since 2026-01-11T00:00:00Z --message-like "Processing failed" --limit 10
Module API
Use query_logfire() for programmatic access:
python1from logger import query_logfire 2 3rows = query_logfire(jsonl=True, level=21, message_like="Processing failed", limit=10) 4for row in rows: 5 print(row)
Environment Variables
Required:
LOGFIRE_READ_URL(e.g.,https://logfire-us.pydantic.dev/v1/query)LOGFIRE_READ_TOKEN
Optional filters:
LOGFIRE_READ_COLUMNSLOGFIRE_READ_LIMITLOGFIRE_READ_SINCELOGFIRE_READ_LEVELLOGFIRE_READ_MESSAGE_LIKELOGFIRE_READ_TRACE_IDLOGFIRE_READ_SPAN_IDLOGFIRE_READ_JSONL=true
Output Format
- JSONL output returns one JSON object per record.
levelis converted to severity strings (trace,debug,info,warn,error,fatal).