A tiny Python tool that turns Codex JSONL session logs into a clean, self‑contained HTML page with a light pastel theme, Markdown rendering, collapsible sections, and a tiny inline code highlighter.
- Input: JSONL logs with events like
message,reasoning,function_call,function_call_output. - Output: One standalone HTML file with inline CSS/JS (UTF‑8, emoji safe).
- Markdown rendering for user, assistant, and reasoning text (
markdown-it-py). - Collapsible panels for reasoning summaries and function outputs with a toolbar to collapse/expand all.
- Fixed‑width blocks for function calls and outputs; long outputs scroll.
- Tiny client‑side highlighter for code fences in Markdown (json, python, bash/sh, diff).
- Hides encrypted reasoning content; shows only the summary text.
- Supports both legacy JSONL events and the new wrapped format where each line is
{ "timestamp": ..., "payload": { ... } }. In the wrapped format, each block shows the event timestamp in the top‑right. - Handles new event kinds found in wrapped logs:
user_message,agent_message,agent_reasoning, andtoken_count(token usage). Token usage renders as a structured block and can be toggled via the toolbar filter. The Token Usage filter is OFF by default.
- Install dependencies
pip install -r requirements.txt- Render a log to HTML
# write to a file
python3 render_jsonl.py example.jsonl -o example.html
# or to stdout
python3 render_jsonl.py example.jsonl > example.html- Batch convert all logs from ~/.codex/sessions
# mirrors the ~/.codex/sessions tree into the current directory,
# converts every .jsonl to .html, and writes a top-level index.html
python3 render_jsonl.py --all
# optional: point to a different sessions dir
python3 render_jsonl.py --all --sessions-dir /path/to/sessions- Open the HTML in your browser
xdg-open example.html # Linux
open example.html # macOS- Sample log: example.jsonl
- Generated HTML: example.html
- Only reasoning and function output blocks are collapsible.
- Function outputs are shown as plain mono text (not Markdown) to avoid accidental formatting.
- The inline highlighter is intentionally minimal; it escapes HTML before injecting token spans.
LGPL 2.0