What an excellent idea. I keep hacking up ruby one-liners to do this when I have moderately complex JSON to generate, this will be so much easier.
Threw together a homebrew tap to make it easier to install on OS X - https://github.com/caius/homebrew-jo
Wonderful! Seems like the same family of tools as the excellent jq: https://stedolan.github.io/jq/
Command line + JSON seems like a great combination. It looks like jo can replace simple commands like ls with json-generating versions, and I wonder how easily one could make commands with more complex output, like netstat, generate JSON, as well.
So good. So useful. And with a homebrew tap too. What a brilliant wake-up-on-Sunday-morning present. Thanks @fcambus and @caius!
I made a similar utility called jarg a while ago, as a way to be able to use the shorthand value syntax of HTTPie in other commands. It differs slightly in that it uses HTML JSON form semantics, and can also output YAML and form-encoding. I think jo has the better name though