All Projects → reegnz → jq-zsh-plugin

reegnz / jq-zsh-plugin

Licence: MIT license
jq zsh plugin

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to jq-zsh-plugin

Z.lua
⚡ A new cd command that helps you navigate faster by learning your habits.
Stars: ✭ 2,164 (+1296.13%)
Mutual labels:  fzf, zsh-plugin
smartcd
Expedite your navigation of Linux filesystem.
Stars: ✭ 35 (-77.42%)
Mutual labels:  fzf, zsh-plugin
fzf-zsh-plugin
ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more.
Stars: ✭ 117 (-24.52%)
Mutual labels:  fzf, zsh-plugin
Fzf Marks
Plugin to manage bookmarks in bash and zsh
Stars: ✭ 343 (+121.29%)
Mutual labels:  fzf, zsh-plugin
Fzf Widgets
ZLE widgets of fzf
Stars: ✭ 72 (-53.55%)
Mutual labels:  fzf, zsh-plugin
Fzf Tab
Replace zsh's default completion selection menu with fzf!
Stars: ✭ 761 (+390.97%)
Mutual labels:  fzf, zsh-plugin
Dotbare
Manage dotfiles and any git directories interactively with fzf
Stars: ✭ 327 (+110.97%)
Mutual labels:  fzf, zsh-plugin
Forgit
💤 A utility tool powered by fzf for using git interactively.
Stars: ✭ 1,823 (+1076.13%)
Mutual labels:  fzf, zsh-plugin
Tmux 1password
🔑 Access your 1Password login items within tmux!
Stars: ✭ 167 (+7.74%)
Mutual labels:  fzf, jq
zeno.zsh
zsh fuzzy completion and utility plugin with Deno.
Stars: ✭ 119 (-23.23%)
Mutual labels:  fzf
nvim configration
Neovim diy develop enviroment.This project integrates neovim tmux zsh and some very useful plugs of them including YouCompleteMe FZF auto pairs nerdtree ncm2 and so on.
Stars: ✭ 22 (-85.81%)
Mutual labels:  fzf
json to paths
Distill a JSON document into a collection of paths both for 'jq' and 'xpath'
Stars: ✭ 65 (-58.06%)
Mutual labels:  jq
zsh
(๑•̀ㅂ•́)و✧ Easily configure zsh themes and plugins for GNU/Linux and Android-Termux.管理数百个zsh插件和主题,支持Alpine,Android,Arch,Debian,Fedora和Void。
Stars: ✭ 73 (-52.9%)
Mutual labels:  zshell
tmuxinator-fzf-start
Uses fzf to provide a selection list for starting tmuxinator projects
Stars: ✭ 31 (-80%)
Mutual labels:  fzf
jqjs
Pure-JavaScript implementation of the jq JSON query language
Stars: ✭ 39 (-74.84%)
Mutual labels:  jq
git
Provides nice git aliases and functions.
Stars: ✭ 26 (-83.23%)
Mutual labels:  zsh-plugin
ycat
Command line processor for YAML/JSON files using Jsonnet
Stars: ✭ 21 (-86.45%)
Mutual labels:  jq
tumult.plugin.zsh
Tumult is a collection of macOS-specific functions and scripts for your shell environment. It is packaged as a ZSH plugin, but can be used with other shells as well.
Stars: ✭ 147 (-5.16%)
Mutual labels:  zsh-plugin
dotfiles
i3, Vim, Bash, Ruby, Typescript & React, Elixir, Golang & more!
Stars: ✭ 22 (-85.81%)
Mutual labels:  fzf
jqkungfu
A jq playground, written in WebAssembly
Stars: ✭ 108 (-30.32%)
Mutual labels:  jq

jq zsh plugin

Interactively build jq expressions (gojq is also supported).

This zsh plugin gives you jq superpowers!

Table of contents

Installation

This plugin requires fzf to be available on your PATH.

The project consists of the following components:

  • a jq-repl command
  • a jq-paths command
  • a jq.plugin.zsh providing line-editor feature utilizing jq-repl

zplug

zplug reegnz/jq-zsh-plugin

Antigen

antigen bundle reegnz/jq-zsh-plugin

Zgen

zgen load reegnz/jq-zsh-plugin

Oh My Zsh

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
git clone https://github.com/reegnz/jq-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/jq
  1. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=( 
	# other plugins...
	jq
)
  1. Start a new terminal session.

Usage

  • type out a command that you expect to produce json on it's standard output
  • press alt + j and interactively write a jq expression
  • press enter, and the jq expression is appended to your initial command!

Key bindings

To bring up the JQ query builder, press alt + j.

During interactive querying, the following shortcuts can be used:

Shortcut Effect
up Navigate path queries
down Navigate path queries
tab Select path query
shift + up Scroll up
shift + down Scroll down
alt + up Scroll up full page
alt + down Scroll down full page
ctrl+r Reload input

gojq support

If you want to use an alternative jq implementation, like gojq then you can override the default jq command used by the plugin, by setting the following environment variable:

JQ_REPL_JQ=gojq

Demos

Interactive jq query construction

asciicast

Insert jq query in the middle of a pipeline

asciicast

Troubleshooting

MacOS: Pressing alt-j creates a symbol in iTerm2

You need to remap your alt-key to Esc+ in iTerm2:

  • Cmd + , to enter preferences
  • Go to Profiles
  • select your profile from the pane on the left hand side
  • go to the keys tab
  • Set Left Option (⌥ ) Key to Esc+

See other suggestions on stackoverflow if the above one doesn't help you: https://stackoverflow.com/q/196357/205318

Another option is to map to ctrl+j instead by putting this in your .zshrc:

bindkey `^j` jq-complete

Disable expanding shell aliases

The plugin automatically expands shell aliases in a command before passing it to jq-repl. To disable, put the following line into your .zshrc:

JQ_ZSH_PLUGIN_EXPAND_ALIASES=0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].