Show HN: JQ-Synth – Generate jq filters from input/output examples (github.com) 1 points by nulone 5mo ago ↗ HN
[–] nulone 5mo ago ↗ I 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": "alice@example.com"}, {"name": "Bob"}, {"name": "Charlie", "email": "charlie@example.com"}] Wanted: ["alice@example.com", "charlie@example.com"] 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.
1 comment
[ 2.8 ms ] story [ 9.9 ms ] threadWhenever 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.