jqp
a TUI playground for exploring jq.
This application utilizes itchynyās implementation of jq written in Go, gojq.
Installation
homebrew
brew install noahgorstein/tap/jqp
macports
Arch Linux
Available through the Arch User Repository as jqp-bin.
Snap install
GitHub releases
Download the relevant asset for your operating system from the latest GitHub release. Unpack it, then move the binary to somewhere accessible in your PATH, e.g. mv ./jqp /usr/local/bin.
Build from source
Clone this repository, build from source with cd jqp && go build, then move the binary to somewhere accessible in your PATH, e.g. mv ./jqp /usr/local/bin.
Usage
ā jqp āhelp
jqp is a terminal user interface (TUI) for exploring the jq command line utility.
You can use it to run jq queries interactively. If no query is provided, the interface will prompt you for one.
The command accepts an optional query argument which will be executed against the input JSON or newline-delimited JSON (NDJSON).
You can provide the input JSON or NDJSON either through a file or via standard input (stdin).
Usage:
jqp [query] [flags]
Flags:
āconfig string path to config file (default is $HOME/.jqp.yaml)
-f, āfile string path to the input JSON file
-h, āhelp help for jqp
-t, ātheme string jqp theme
-v, āversion version for jqp
jqp also supports input from STDIN. STDIN takes precedence over the command-line flag. Additionally, you can pass an optional query argument to jqp that it will execute upon loading.
ā curl āhttps://api.github.com/repos/jqlang/jq/issuesā | jqp ā.[] | {ātitleā: .title, āurlā: .url}ā
Keybindings
Keybinding
Action
tab
cycle through sections
shift-tab
cycle through sections in reverse
ctrl-y
copy query to system clipboard1
ctrl-s
save output to file (copy to clipboard if file not specified)
ctrl-c
quit program / kill long-running query
Query Mode
Keybinding
Action
enter
execute query
ā/ā
cycle through query history
ctrl-a
go to beginning of line
ctrl-e
go to end of line
ā/ctrl-b
move cursor one character to left
ā/ctrl-f
move cursor one character to right
ctrl-k
delete text after cursor line
ctrl-u
delete text before cursor
ctrl-w
delete word to left
ctrl-d
delete character under cursor
Input Preview and Output Mode
Keybinding
Action
ā/k
up
ā/j
down
ctrl-u
page up
ctrl-d
page down
Configuration
jqp can be configured with a configuration file. By default, jqp will search your home directory for a YAML file named .jqp.yaml. A path to a YAML configuration file can also be provided to the āconfig command-line flag.
ā jqp āconfig ~/my_jqp_config.yaml

