https://github.com/gpanders/ijq
Interactive jq (mirror)
https://github.com/gpanders/ijq
command-line golang jq terminal
Last synced: 7 months ago
JSON representation
Interactive jq (mirror)
- Host: GitHub
- URL: https://github.com/gpanders/ijq
- Owner: gpanders
- License: gpl-3.0
- Created: 2020-07-06T14:11:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T18:23:36.000Z (over 1 year ago)
- Last Synced: 2024-05-01T16:08:44.419Z (over 1 year ago)
- Topics: command-line, golang, jq, terminal
- Language: Go
- Homepage: https://sr.ht/~gpanders/ijq
- Size: 3.23 MB
- Stars: 178
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: history.go
- License: COPYING
Awesome Lists containing this project
README
ijq
===Interactive `jq` tool. Like [jqplay] for the commandline.
[jqplay]: https://jqplay.org
Demo
----
Installation
------------### Install from package manager
[](https://repology.org/project/ijq/versions)
### Build from source
Install [go]. To install `ijq` under `/usr/local/bin/` simply run
make install
from the root of the project. To install to another location, set the `PREFIX`
variable, e.g.make PREFIX=~/.local install
To generate the man page you will also need to have [scdoc] installed.
[go]: https://golang.org/dl/
[scdoc]: https://sr.ht/~sircmpwn/scdocUsage
-----ijq uses [jq] under the hood, so make sure you have that installed first.
Read from a file:
ijq file.json
Read from stdin:
curl -s https://api.github.com/users/gpanders | ijq
Press `Return` to close `ijq` and print the current filtered output to stdout.
This will also print the current filter to stderr. This allows you to save the
filter for re-use with `jq` in the future:ijq file.json 2>filter.jq
# Same output as above
jq -f filter.jq file.jsonPressing `Return` also saves the filter to a history file
(`$XDG_DATA_HOME/ijq/history` by default). You can browse the history by
deleting everything in the filter field. Change the history file used with the
`-H` option, or specify an empty string to disable history entirely (i.e. `-H
''`).If `$XDG_DATA_HOME` is undefined, then the directory used is [platform
dependent][xdg].Use `Shift` plus the arrow keys to move between the different windows. When
either of the input or output views have focus, you can use the arrow keys to
scroll up and down. Vi keys also work, i.e. you can use `j`/`k` to scroll up or
down, `g` to move to the top of the view, `G` to jump to the bottom of the
view, and `Ctrl-F`/`Ctrl-B` to scroll up or down a page at a time.Use `Ctrl-C` to exit `ijq` immediately, discarding all filters and state.
You can configure the colors by setting the `JQ_COLORS` environment variable.
See the [jq documentation][colors] for more details.[jq]: https://jqlang.github.io/jq/
[colors]: https://jqlang.github.io/jq/manual/#colors
[xdg]: https://github.com/kyoh86/xdg#xdg-base-directoryContributing
------------Bugs can be reported on the [issue tracker][issues]. PRs are accepted on
[GitHub][github] or [Codeberg][codeberg].[issues]: https://codeberg.org/gpanders/ijq/issues
[github]: https://github.com/gpanders/ijq
[codeberg]: https://codeberg.org/gpanders/ijqNote for Packagers
------------------Subscribe to release announcements on [Codeberg][codeberg] to be notified of
new releases, or subscribe to the [RSS
feed](https://codeberg.org/gpanders/ijq/releases.rss).Similar Work
------------- [jqplay]
- [vim-jqplay][vim-jqplay]: https://github.com/bfrg/vim-jqplay
License
-------[GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)