208 points · by fiatjaf · 6y ago · 56 comments
echo '' | fzf --print-query --preview "cat *.json | jq {q}"
https://paweldu.dev/posts/fzf-live-repl/I should probably update it with a couple of life improvements now that I think about it.
I'll look into it for sure!
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?
[
{
"a": 1,
"b": 2
},
{
"a": 5,
"b": 6
},
]
what exactly do you want to do with it?Kind of similar to how some Git extensions show who has the last commit on a certain line of code when you click/place cursor on a line
https://apps.apple.com/us/app/json-editor/id567740330?mt=12
jq and the like are great, but when you're trying to understand something... NSTableView is often times easier to fall back to, haha.
If someone else uses it I'd be interested in their thoughts.
Something like:
https://jq.io/https://myapi.com/endpoint?jqparams=$PARAMS
So like bash via HTTP :)
Retool does this btw. I work there because the product is SICK!
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 :)
- jo: convert shell ouput to JSON
- jiq: interactive jq, useful when building complex jq queries
it's a single file python/tk script, requires no installation and no dependencies other than standard python
"..drill down JSON interactively by using filtering queries like jq"
jiq is probably a better tool.
If you're not a fan of jq for its syntax, check out jql[1]. It too helps you to transform json files, but does so with a consistent, lispy syntax.
cat json | jq | less
I checked the code, it's concatenating the output with newlines. Not necessary at all. jq . -C | less -RTo be fair, the readme doesn't explain it well. This is a GUI app that allows you to see the jq results in real time. Here [1] is a video.
jq . < json | less
Sorry for being pedantic. Moving on.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.
jq . json | less < json jq . | lessFor 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.
Also duckduckgo can be better than google sometimes
Plenty of results still slip through, and it seems some people abbreviate jQuery to jq anyway.