Option 1 - Simple formatting using python
If you have access to python on your system, simply add an alias to "python -mjson.tool" to pretty print any well formed json. Execute one of the following commands to add the alias directly (depending on whether you use bash or zsh):
See an example in action:
Option 2 - Prettyjson: a colorized option
prettyjson is a node.js package that you can call form the command line to get colorized and bracket stripped json printed in your CLI.
Once installed, you can try it out. Here is a before shot:
As you can see prettyjson does a good job of stripping superflous brackets and quotes.
Note: If you can't execute prettyjson after installing it, make sure the node package manager bin folder is in your path. You can do so by adding the following to your .bashrc/zshrc:
Option 3 - underscore-cli
Yet another node.js based option is the underscore-cli package. It doesn't strip some of the less useful json characters form the display like prettyjson, but it does colorize your text and it has other powerful features.
sudo npm install -g underscore
Underscore pretty formatting in action:
It's not just pretty printing that makes this package neat, you can extract specific portions of it as well:
Head on over to ddposon's github page for more details.