This uses https://github.com/itchyny/gojq which is a pure Go re-implementation of jq. Can be used as a cli tool or as a library. Didn't know about this, very cool that it exists!
Thanks for your plugin. I wish it had up arrow history. I keep a separate text log with commands and it would be nice if the plugin tracked them. Especially given the high numbers of jq syntax errors.
Is there a way to instantly find out what filter to use when you click on a certain row? Kind of like doing exploratory jq on VSCode so you can quickly move it to the shell?
yep, gron simply rewrites json into a sane format that can be then transformed by the standard tools (grep, cut, sed, awk, ...). In practice, I use gron mostly to print json data in a human readable and editable format.
It likely works about as fine as NSJSONSerialization does, which is to say: I've had no issues, although the "validating" does sometimes lag and that can be annoying.
If someone else uses it I'd be interested in their thoughts.
I started using `jq` for my API project and I have to say it makes JSON munging much nicer on the command line. I think it'd be really cool in order to have a `jq` based redirection service, where you can paste in the URL of the API you want and a query parameter of the `jq` query you want to create.
Oh cool! Kinda wish you had url params vs. having to curl with request data (kinda like https://cors-anywhere.herokuapp.com/), but wayyy better than nothing!
I think `jq`'s syntax is a bit different than bare JSON (I do basic stuff like `echo $CHANNELS_RESPONSE | jq -r ".public_identifier"`), I think it'd be like running a bash script as an input to a query :)
Also not sure whether to start repping TinyDev (my project) but I can pass in an arbitrary read-only SQL query via HTTP to create a materialized view from table(s). HTTP + local procedures is like a very simple RPC :)
This is pretty tangential, but it’s interesting to me that the examples use Mises, Hayek, and Menger. These are three famous economists that of which Menger is a shared ancestor in the other two’s academic-advisor-genealogy. In academic advisor genealogy being a direct descendant of one academic advisor just means that you had them as an advisor, thus since an advisor has multiple Ph.D. students It creates a family tree like structure. Anyways, I only learned this, because my Dad is actually an academic advisor descendant of Mises and Menger. Anyways if there is any Ph.D.s lurking here on hacker news in a mathematical field you might be able to find your own advisor genealogy here: https://www.genealogy.math.ndsu.nodak.edu/id.php?id=200008
This doesn't seem to work that well. If you type invalid syntax, like '.[' then the window suddenly resizes to accomodate the error message, but not all of the text boxes resize.
Your hat tip to the famous Austrian economists in your examples, and the "fiat" part of your username are enough to indicate to me that we could be good friends ;-)
Yes, you can re-write it without using cat, but many people (including me) think it's clearer to read from left-to-right. Plus the mixing of sending the file through stdin and then using a pipe always makes my brain pause.
I just personally find that using cat as the first part of the pipeline makes everything easier.
Plus, if you're going to argue against useless use of cat, there's also no reason to send the file in through stdin. jq can read the file directly.
For browsing a JSON file I can also recommend jsonfui. I've been using it for many years now and I'm actually surprised it doesn't have more stars on GitHub.
I like https://github.com/akavel/up as this works on the command line and helps building fast pipes not only with jq, but also with every other text wrangling tool. But I wish it would be a little bit more polished.
I wish jq had a different name. I don't know its functions and (JSONPath's?) syntax well, so I'm frequently trying to use it in a hurry and digging through jQuery search results to find what I need.