Recently I needed to query something from a json document, but I just couldn't figure out how to express this in jq. In my spare time I'm working on a toy configuration language that is a superset of json, and expressing the query there was pretty straightforward, at least to me. So I added a mode to do that, and it comes in pretty handy once in a while now as a jq alternative.
2m28s from time I downloaded hosts.json to producing this solution, though I must admit I had to take a moment to look up contains to realized it had to take an array—I could've used index/1 and had a better time.
I didn't time myself, but took 25-50% more queries.
I'll echo the value of ijq, https://sr.ht/~gpanders/ijq/ The live updating makes for less to remember and visualize. Though there is some value in having intermediate history recorded, for the second and later questions you ask of the data. (And supports commenting out for error diagnosis without deleting half the expression, `# ...`, hash and space required.)
I hadn't known of `debug`, quite convenient. I've often used multiple outputs at the tail, for example `... | keys, .` to remind myself of the structure as I explore down. Also `gron` and `fzf --multi`.
I tried GPT-3.5, it got it wrong but it did get the overall setup right, just forgot about a detail. But I don't want to reach for ChatGPT every time I need to query something, I want something that I can write without having to solve a puzzle first. (True, maybe I should spend some time learning jq better.)
https://fosstodon.org/@ruuda/111120049523534027