gson-viewer is an interactive command-line JSON viewer.
go get github.com/hlts2/gson-viewer
An interactive command-line JSON viewer demo.
To launch an interactive command-line JSON viewer from file.
gson-viewer -s {json file}
To launch an interactive command-line JSON viewer from pipe.
cat test.json | gson-viewer
The path is syntax such as created_at.date
. And if you want to get the element of array, please put a number such as friends.[0]
.
{
"friends": [
{"name": "hlts2"},
{"name": "hiroto"}
],
"created_at": {
"date": "2017-05-10 12:54:18",
"timezone": "UTC"
}
}
>>> friends.[1].name
// hiroto
The show
command shows shaped JSON
>>> show
ctl-d