https://github.com/hlts2/gson-viewer
Interactive command-line JSON viewer.
https://github.com/hlts2/gson-viewer
cli cli-app cli-tool command-line-tool golang gson-viewer hlts2 interactive json json-parsing json-viewer repl viewer
Last synced: about 2 months ago
JSON representation
Interactive command-line JSON viewer.
- Host: GitHub
- URL: https://github.com/hlts2/gson-viewer
- Owner: hlts2
- License: mit
- Created: 2018-02-17T13:24:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-09T14:28:16.000Z (over 4 years ago)
- Last Synced: 2025-01-20T08:09:33.400Z (9 months ago)
- Topics: cli, cli-app, cli-tool, command-line-tool, golang, gson-viewer, hlts2, interactive, json, json-parsing, json-viewer, repl, viewer
- Language: Go
- Homepage:
- Size: 3.43 MB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gson-viewer [](https://opensource.org/licenses/MIT) [](https://goreportcard.com/report/github.com/hlts2/gson-viewer) [](https://gitter.im/gson-viewer/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
gson-viewer is an interactive command-line JSON viewer.## Install
```shell
go get github.com/hlts2/gson-viewer
```## Demo
An interactive command-line JSON viewer demo.

## Example
### File Mode
To launch an interactive command-line JSON viewer from file.
```shell
gson-viewer -s {json file}
```
### Pipe Mode
To launch an interactive command-line JSON viewer from pipe.
```shell
cat test.json | gson-viewer
```
### REPL Mode
#### How to get JSON valueThe 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]`.
```json
{
"friends": [
{"name": "hlts2"},
{"name": "hiroto"}
],
"created_at": {
"date": "2017-05-10 12:54:18",
"timezone": "UTC"
}
}
``````shell
>>> friends.[1].name
// hiroto
```#### `show` command
The `show` command shows shaped JSON
```shell
>>> show
```#### How to exit
```
ctl-d
```