Ok, I've just hacked a version of this that uses jq[0] underneath, so you can do all the sorts of fancy queries jid originally doesn't support: <a href="https://github.com/fiatjaf/jiq" rel="nofollow">https://github.com/fiatjaf/jiq</a><p>[0]: <a href="https://stedolan.github.io/jq/manual/" rel="nofollow">https://stedolan.github.io/jq/manual/</a>
The JSON crowd is re-inventing LISP. Originally, JSON was a subset of what you could pass to "eval()". Yesterday, state machine programming in JSON. Today, an inspector.
I personally like digging in a ruby console, e.g.:<p><pre><code> require 'json'
require 'open-uri'
data = JSON.load(open("https://api.github.com/users/Dorian"))
data.keys
data.first
data["public_repos"]
</code></pre>
etc.
I built a similar thing recently with python. Not complete, but a bunch of stuff does work. It's modeled on interacting on-device with a JunOS or Cisco config. Probably the most interesting feature is text completion.<p><a href="https://github.com/mypalmike/ijsoned" rel="nofollow">https://github.com/mypalmike/ijsoned</a>
Shameless, but related plug [0] - an interactive JSON log viewer.<p>[0] <a href="https://github.com/pkamenarsky/sherlock" rel="nofollow">https://github.com/pkamenarsky/sherlock</a>
How can I use wildcards in queries?<p>For example consider this.<p><pre><code> echo '{"users":[{"name":"s1","id":1},{"name":"s2","id":2}]}'|jid
</code></pre>
I can query users[0].id or users[1].id. How can I get all the ids? I tried users[*].id which didn’t work.<p>In Clojure I use specter [1] for this which is able to handle wildcards using ALL.<p>[1] <a href="https://github.com/nathanmarz/specter" rel="nofollow">https://github.com/nathanmarz/specter</a>
When should/shouldn't I use this over jq? Is the main difference that this is interactive while jq is not? How similar/different is the syntax?