Show HN: JQ-Synth – Generate jq filters from input/output examples(github.com)1 points·by nulone·6 mesi fa·1 commentsgithub.comShow HN: JQ-Synth – Generate jq filters from input/output exampleshttps://github.com/nulone/jq-synth1 commentsPost comment[–]nulone·6 mesi fareplyI can never remember jq syntax.Whenever I need to transform JSON, I spend 20 minutes guessing filters until something works.So I built a CLI tool: give it input JSON and desired output, it generates the jq filter.Example: Input: [{"name": "Alice", "email": "[email protected]"}, {"name": "Bob"}, {"name": "Charlie", "email": "[email protected]"}] Wanted: ["[email protected]", "[email protected]"] Generated: [.[] | select(.email != null) | .email] How it works:1. Takes your input/output examples2. Generates a filter, runs jq, verifies the output matches3. If wrong, retries automaticallyWorks with local models (Ollama) or cloud (OpenAI/Anthropic).~450 tests, MIT licensed.Curious what edge cases break it.
Whenever I need to transform JSON, I spend 20 minutes guessing filters until something works.
So I built a CLI tool: give it input JSON and desired output, it generates the jq filter.
Example:
How it works:
1. Takes your input/output examples
2. Generates a filter, runs jq, verifies the output matches
3. If wrong, retries automatically
Works with local models (Ollama) or cloud (OpenAI/Anthropic).
~450 tests, MIT licensed.
Curious what edge cases break it.