You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
That should put thegrontojq executable in$GOBIN. If that's in$PATH,which grontojq should point you to it.
ℹ️ How one might usegrontojq
This is a Go tool that convertsgron output intojq commands. I wrote this to solve a specific problem I had and as an excuse to write in Go again.
I typically usegron to help build thejq command I want to use for whatever I'm trying to do. While--ungron is nice, I don't want to havegron as a dependency in pipelines or other places where I'm making use ofjq. I usegron to help build thejq commands. Once I have them, I use justjq for the actual parsing.
You can pipe the output ofgron in togrontojq. Here's how I thinkgrontojq is most useful:
First, you'll usegron cats.json to explore the JSON file you're interested in:
You can copy this from your terminal or usepbcopy or similar to copy it straight to your clipboard with something likegron cats.json | grep 11 | grep word | grontojq | pbcopy.
Finally, you'll take the output fromgrontojq and use it to parse the file more elegantly:
jq '.catDescriptions[11].word' cats.json
🐈⬛ Why?
This makes it a tiny bit easier to go fromgron output tojq filter -- especially if piping to something likegrontojq is easy to add to your terminal muscle memory. I'd alias it to something likeg2jq or similar to make that even easier.
About
A Go tool to convert gron output to useful jq commands.