I built a CLI that turns a browser HAR capture into a typed TypeScript client

Wait 5 sec.

I often end up integrating with apps that have no API docs, and I was tired of spending an afternoon in the Network tab figuring out the endpoints, which fields are optional and how auth works. So I made har2sdk as a side project. You save the Network tab as a .har and run: npx har2sdk capture.har It writes a typed client.ts with no runtime dependencies and an openapi.json (3.1). There is also a mock server (`har2sdk mock capture.har`) that serves fake data in the recorded shape, and an optional MCP server. It handles REST, GraphQL, JSON-RPC and tRPC. Types are inferred from all recorded calls, so a field that is missing in some responses becomes optional. Auth is detected from how the app did it, but you pass your own token. The part I spent the most time on is privacy, since HAR files contain cookies, tokens and other people's data. If a recorded value would end up in the generated code or the spec, it writes nothing. It is a heuristic, not a proof, so `har2sdk inspect` lets you check what it found before you publish anything. It runs locally, needs no API key, and is MIT licensed: https://github.com/Mersbyte/har2sdk Feedback is welcome, especially on types it gets wrong. If something breaks, please send the output of `har2sdk inspect --json` and not the HAR file, because a HAR contains your session.   submitted by   /u/HiAxiAcee [link]   [comments]