• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H31-Mar-2019-3433

cmd/jid/H31-Mar-2019-197149

src/github.com/simeji/jid/H03-May-2022-

vendor/H03-May-2022-432,133355,779

.gitignoreH A D31-Mar-2019322 3427

.goreleaser.ymlH A D31-Mar-2019821 4443

ChangeLogH A D31-Mar-2019658 4629

LICENSEH A D31-Mar-20191 KiB2217

README.mdH A D31-Mar-20193.7 KiB14699

engine.goH A D31-Mar-20196.8 KiB333295

engine_test.goH A D31-Mar-20198.9 KiB372296

go.modH A D31-Mar-2019416 1311

go.sumH A D31-Mar-20191.4 KiB1716

json_manager.goH A D31-Mar-20193.2 KiB141114

json_manager_test.goH A D31-Mar-201912.4 KiB466345

query.goH A D31-Mar-20195.1 KiB263231

query_test.goH A D31-Mar-201911.1 KiB493386

suggestion.goH A D31-Mar-20192.9 KiB151128

suggestion_test.goH A D31-Mar-20193.5 KiB10281

terminal.goH A D31-Mar-20195.7 KiB275231

README.md

1# jid
2
3[![Circle CI](https://circleci.com/gh/simeji/jid/tree/master.svg?style=shield)](https://circleci.com/gh/simeji/jid/tree/master)
4
5Json Incremental Digger
6
7It's a very simple tool.
8You can drill down JSON interactively by using filtering queries like [jq](https://stedolan.github.io/jq/).
9
10**Suggestion** and **Auto completion** of this tool will provide you a very comfortable JSON drill down.
11
12## Demo
13
14![demo-jid-main](https://github.com/simeji/jid/wiki/images/demo-jid-main-640-colorize.gif)
15
16## Installation
17
18* [With homebrew (for Mac)](#with-homebrew-for-mac)
19* [With pkg (for FreeBSD)](#with-pkg-for-freebsd)
20* [Other package management system](Other-pkg-management-system)
21* [Simply use "jid" command](#simply-use-jid-command)
22* [Build](#build)
23
24### With homebrew (for Mac)
25
26```
27brew install jid
28```
29
30### With pkg (for FreeBSD)
31
32```
33pkg install jid
34```
35
36### Other package management system
37
38Jid can install by package management systems of below OS.
39
40[![Packaging status](https://repology.org/badge/vertical-allrepos/jid.svg)](https://repology.org/metapackage/jid/versions)
41
42
43### Simply use "jid" command
44
45If you simply want to use `jid` command, please download binary from below.
46
47https://github.com/simeji/jid/releases
48
49## Build
50
51```
52go get -u github.com/simeji/jid/cmd/jid
53```
54
55## Usage
56
57### Quick start
58
59* [simple json example](#simple-json-example)
60* [simple json example2](#simple-json-example2)
61* [with initial query](#with-initial-query)
62* [with curl](#with-curl)
63
64#### simple json example
65
66Please execute the below command.
67
68```
69echo '{"aa":"2AA2","bb":{"aaa":[123,"cccc",[1,2]],"c":321}}'| jid
70```
71
72then, jid will be running.
73
74You can dig JSON data incrementally.
75
76When you enter `.bb.aaa[2]`, you will see the following.
77
78```
79[Filter]> .bb.aaa[2]
80[
81  1,
82  2
83]
84```
85
86Then, you press Enter key and output `[1,2]` and exit.
87
88#### simple json example2
89
90This json is used by [demo section](https://github.com/simeji/jid#demo).
91```
92echo '{"info":{"date":"2016-10-23","version":1.0},"users":[{"name":"simeji","uri":"https://github.com/simeji","id":1},{"name":"simeji2","uri":"https://example.com/simeji","id":2},{"name":"simeji3","uri":"https://example.com/simeji3","id":3}],"userCount":3}}'|jid
93```
94
95#### With a initial query
96
97First argument of `jid` is initial query.
98(Use JSON same as [Demo](#demo))
99
100![demo-jid-with-query](https://github.com/simeji/jid/wiki/images/demo-jid-with-query-640.gif)
101
102#### with curl
103
104Sample for using [RDAP](https://datatracker.ietf.org/wg/weirds/documents/) data.
105
106```
107curl -s http://rdg.afilias.info/rdap/domain/example.info | jid
108```
109
110#### Load JSON from a file
111
112```
113jid < file.json
114```
115
116## Keymaps
117
118|key|description|
119|:-----------|:----------|
120|`TAB` / `CTRL` + `I` |Show available items and choice them|
121|`CTRL` + `W` |Delete from the cursor to the start of the word|
122|`CTRL` + `U` |Delete whole query|
123|`CTRL` + `F` / Right Arrow (:arrow_right:)|Move cursor a character to the right|
124|`CTRL` + `B` / Left Arrow (:arrow_left:)|Move cursor a character to the left|
125|`CTRL` + `A`|To the first character of the 'Filter'|
126|`CTRL` + `E`|To the end of the 'Filter'|
127|`CTRL` + `J`|Scroll json buffer 1 line downwards|
128|`CTRL` + `K`|Scroll json buffer 1 line upwards|
129|`CTRL` + `G`|Scroll json buffer to bottom|
130|`CTRL` + `T`|Scroll json buffer to top|
131|`CTRL` + `N`|Scroll json buffer 'Page Down'|
132|`CTRL` + `P`|Scroll json buffer 'Page Up'|
133|`CTRL` + `L`|Change view mode whole json or keys (only object)|
134|`ESC`|Hide a candidate box|
135
136### Option
137
138|option|description|
139|:-----------|:----------|
140|First argument ($1) | Initial query|
141|-h | print a help|
142|-help | print a help|
143|-version | print the version and exit|
144|-q | Output query mode (for jq)|
145|-M | monochrome output mode|
146