CLI JSON Formatting

JSON can be difficult to read in some of its more concise representations. On Unix based systems you can format it using the standard python install.

$ echo '{"foo":"bar"}' | python -m json.tool

For syntax highlighted output use jq. You can install it via homebrew with brew install jq.

$ echo '{"foo":"bar"}' | jq '.'
Posted on 4 November 2015 in cli