Code Monkey home page Code Monkey logo

jq-zsh-plugin's Introduction

jq zsh plugin

Interactively build jq expressions.

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

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

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

  • 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+

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

jq-zsh-plugin's People

Contributors

johnhamelink avatar reegnz avatar

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.