Skip to content

Instantly share code, notes, and snippets.

@ylmrx
Created May 31, 2022 17:57
Show Gist options
  • Save ylmrx/2395f049957149a2181be1eb61ea867b to your computer and use it in GitHub Desktop.
Save ylmrx/2395f049957149a2181be1eb61ea867b to your computer and use it in GitHub Desktop.
color jq request builder
jzq() {
local in
temp=`mktemp`
while read in; do
echo "$in" >> $temp
done
fzf --print-query --preview \
"cat $temp | jq {q} | bat -l json --color always -n -p" \
--preview-window 'top,99%' --reverse --no-info <<< ''
rm $temp
}
@ylmrx
Copy link
Author

ylmrx commented May 31, 2022

install bat and jq.
this should work with any bash-able environment.

example command:

$ kubectl get pods -o json | jzq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment