Back to directory

json-repair

A Go library and CLI that automatically detects and fixes malformed JSON output from large language models, such as unclosed brackets, mixed quotes, or trailing commas.

json-repair

json-repair fixes JSON anomalies commonly produced by large language models, such as single quotes, unescaped line feeds, improperly capitalized booleans and null, mixed quote styles, unclosed arrays or objects, standalone brackets, malformed key-value pairs, and inline comments. It always returns a string result rather than raising an error on malformed input.

It has zero external dependencies and includes a test suite of known broken JSON patterns. It can be used as a Go library or from the command line, where it can be chained with other commands through pipes.

It is written in Go and licensed under GPL-3.0.

More in CLI tools

See all 181
  • grev

    github.com

    A set of Unix coreutils-style filters — grep, sort, cut and more — that answer a plain-language question about each record instead of matching a pattern, using a small decision model.

  • A Node.js script that exports a Google Doc to HTML and CSS with high fidelity, preserving headings, spacing, alignment, bullet lists, images and right-to-left text.

  • gpusched

    github.com

    A VRAM-aware GPU job scheduler for a single machine: declare how much memory each shell command needs, and it places jobs the moment a GPU has room and reports when a guess was wrong.