Tuesday, 4 April 2023

TIL: FuzzyFinder - fzf - and jq

Today I learned ( well, actually it was yesterday but who's counting days ? ) about fzf in the context of using it to test JQ expressions.

The revelation came from Julia Evans, author of WizardZines, aka b0rk, about whom I've written before.

She'd mentioned the use of fzf and jq in a post on Mastodon: -


so I had to try it out ...

Install fzf

brew install fzf

Create a JSON document

cat << EOF > the_simpsons.json
[
    {
        "givenName": "Maggie",
        "familyName": "Simpson"
    },
    {
        "givenName": "Lisa",
        "familyName": "Simpson"
    },
    {
        "givenName": "Marge",
        "familyName": "Simpson"
    },
    {
        "givenName": "Homer",
        "familyName": "Simpson"
    },
    {
        "givenName": "Bart",
        "familyName": "Simpson"
    }
]
EOF

Fire up fzf

echo '' | fzf --preview 'jq {q} < the_simpsons.json'

Tinker with various jq queries




Nice!

No comments:

Reminder - installing podman and skopeo on Ubuntu 22.04

This follows on from: - Lest I forget - how to install pip on Ubuntu I had reason to install podman  and skopeo  on an Ubuntu box: - lsb_rel...