harlite: query HAR files with SQL
I made HAR files queryable.
I keep running into HAR files when debugging front-end stuff and when asking a coding agent, "what actually happened on the wire?" The capture is useful, but it is also a giant JSON blob.
So I built harlite: a tiny CLI that imports HAR (HTTP Archive) into SQLite so you can query web traffic with SQL.
HAR is a great capture format, and a terrible interface
HAR is a snapshot of browser network activity. It is also a pile of nested arrays and optional fields. Most workflows devolve into jq one-liners you regret later.
If you can express the question as SQL, you can reuse it, diff it, and hand it to an agent without teaching it your JSON shape.
SQLite makes the questions obvious
Import once:
harlite import capture.har
Then ask normal questions:
sqlite3 capture.db "SELECT url, status, time_ms FROM entries WHERE status >= 400 ORDER BY time_ms DESC LIMIT 20"
Agents already speak SQL. Humans do too. It is a surprisingly good shared language for "find the weird stuff in this trace".
Response bodies are optional, and deduped
By default, harlite only imports metadata (URLs, headers, timings, status codes). If you opt in to storing bodies, it deduplicates them with content-addressable hashing (BLAKE3), so repeated bundles do not explode your database.
This is a tradeoff: you get speed and small size when you want it, and deeper analysis when you need it.
You can always export back to HAR
I did not want a one-way conversion. harlite can export a database back to HAR, with filters (host, status, method, date range, and more). That makes it easier to slice a huge capture into something you can share or attach to a bug report.
If you try it, tell me what hurts
The repo is here: https://github.com/brucehart/harlite
If you use HARs with agents, I would love examples of the questions you keep asking and the schema you wish you had.