Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.46 KB

File metadata and controls

60 lines (42 loc) · 1.46 KB

json-patcher

The chief cook and bottle washer of json patching

Overview

json-patcher is a tool that processes JSON files and generates patches, fixes, and changelogs. This project helps manage and track changes between different JSON files.

Features

  • Generate patches between JSON files
  • Generate human-readable descriptions from patch files
  • Apply patch files to JSON files
  • Append generated descriptions to a changelog
  • Emit JSON output for automation with --json

LLM Compatibility

The describe command currently expects an OpenAI-compatible Chat Completions API.

  • Expected request shape: {"model": "...", "messages": [...]}
  • Expected response shape: choices[0].message.content

This works with OpenAI and providers/proxies exposing an OpenAI-compatible Chat Completions endpoint. Anthropic’s native Messages API is not directly supported.

Installation

bbin install io.github.200ok-ch/json-patcher

Usage

Examples

json-patcher diff old.json new.json --out changes.patch
json-patcher describe changes.patch --append CHANGELOG.md
json-patcher apply old.json fix.patch --out old-fix.json
json-patcher diff old.json new.json --json

Requirements

  • Babashka
  • jsondiff/jsonpatch
  • OpenAI API Key (optional)

Examples

./json_patcher.bb diff li-20260302T092642Z-v1.json li-20260302T092703Z-v2.json --out patch-v1-v2.json --json