Giter VIP home page Giter VIP logo

ijq's Introduction

ijq

Interactive jq tool. Like jqplay for the commandline.

Demo

Demo

Installation

Install from package manager

Packaging status

Download a pre-compiled release

Select the version you want to download from sourcehut and download one of the pre-compiled releases from that page. Then extract the archive and copy the binary and, optionally, the man page to the correct location.

Example:

wget https://git.sr.ht/~gpanders/ijq/refs/download/vX.Y.Z/ijq-vX.Y.Z-linux-amd64.tar.gz
tar xf ijq-vX.Y.Z-linux-amd64.tar.gz
cd ijq-vX.Y.Z
cp ijq /usr/local/bin
mkdir -p /usr/local/share/man/man1
cp ijq.1 /usr/local/share/man/man1

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.

Usage

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.json

Pressing 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.

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 for more details.

Contributing

Have a question, comment, or feature request? Send an email to the mailing list.

Report bugs on the ticket tracker. You can file a ticket without a sourcehut account by sending a plain text email to ~gpanders/[email protected].

Send patches to ~gpanders/[email protected] or open a pull request on GitHub or Codeberg.

Similar Work

License

GPLv3

ijq's People

Contributors

gpanders avatar herbygillot avatar mattpolzin avatar stefanvanburen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ijq's Issues

Feature request: tab-completion of keys?

Wow, this was a really nice utility, thank you for making and sharing this with the world!
What do you think about perhaps remapping [tab] to perform a straight forward tab completion?
Or, to keep the existing tab/shift-tab for focus/pane movement: perhaps first generate a list of possible JSON dot notation paths, then after user types that list narrows down, and arrows up/down selects from this list? Especially with JSON keys like these:

 "registreringsdatoEnhetsregisteret": "2007-02-13",
 "registrertIMvaregisteret": true,
 "naeringskode1": {

said feature would save a bit of typing :)

Actually, since ijq input is in fact in dot notation form, perhaps you can see if you can leverage the also very excellent and useful tomnomnom/gron? Throw in a clever fzf feedback loop here, and everything is set for some kind of fzijqron frankentool 🤣

brew install gpanders/tap/ijq fails to SHA256 mismatch

Here's what I get:

 brew install gpanders/tap/ijq
==> Installing ijq from gpanders/tap
==> Downloading https://homebrew.bintray.com/bottles/go-1.15.8.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/61a70ed89335dc8819b278670bf2919a69fa3909a316a3acc6aa2d2ac07a1374?response-content-disposition=attachment%3Bfilename%3D%22go-1.15.8.catalina.bottl
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/scdoc-1.11.1.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://git.sr.ht/~gpanders/ijq/archive/v0.2.4.tar.gz
-#O#- #   #
Error: SHA256 mismatch
Expected: 39d88fa66c232aa2cc3aa7207810f22f8e762981d8a60d326cb9fcd59f75fa54
  Actual: 1060f48ceb0b8770531253cfe3b98b29b35e54655b794008ed78fc3079a01140
    File: /Users/user/Library/Caches/Homebrew/downloads/9c046fb0a173f32d4a34b6c08811114bdf17a7c88ad8b1807336cb41be94d03f--ijq-v0.2.4.tar.gz
To retry an incomplete download, remove the file above.

I tried brew cleanup and removing the tarballs, no luck.

Here's my diagnostic info:

$ brew --version
Homebrew 3.0.1
Homebrew/homebrew-core (git revision 70345; last commit 2021-02-17)
Homebrew/homebrew-cask (git revision b43e8; last commit 2021-02-17)

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.7
BuildVersion:   19H15

$ uname -a
Darwin WRPOLMBP91 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.