This is painful. In powershell this is built in and as easy as iwr url/to/json | convertfrom-json | other logic
It's a beefy package, though. Packaged in a docker image on top of alpine:3.10.3 following their installation instructions for alpine: https://gist.github.com/nkashy1/643e7a263054c02e2caceb3912f8...
The image comes in at 178 MB. alpine:3.10.3 is 5.5 MB. An alpine image in which you add bash, bash-doc, and bash-completion clocks in at 13 MB.
Sounds really powerful for personal use, but not an ideal tool for production use (e.g. when you need to spin up a pod on a Kubernetes cluster to debug an issue in production). Will definitely try it out.
xidel url -e 'logic'
and one such xidel call is enough regardless, if the url returns json, xml or html.
The thing I like about curl + jq is that I can easily switch it out for:
TEMPFILE=`mktemp`; curl -s <REQUEST> >$TEMPFILE; python -c "import json; f = open('$TEMPFILE', 'r'); d = json.load(f); <json processing logic and print statement>; f.close()"
and run in my CI environments or ship in docker images for testing purposes.
That said, I do see the potential for a tool like this. What I would like is the ability to manage different profiles for different URLs from the command line. Profiles could just be collections of header specifications - "Authorization: Bearer <blah>" or "Content-Type: application/json"
(Maybe https://github.com/postmanlabs/newman#using-newman-cli ? Didn't know about it until now.)