Skip to content

Instantly share code, notes, and snippets.

@grdscrc
grdscrc / jazz.sh
Last active November 17, 2023 00:32
jazz : list paths from a json input, fuzzy search a node, get its content ; useful with large payloads
#!/usr/bin/env bash
# Tested with jq 1.6 & fzf 0.42.0
# Inspired by https://github.com/reegnz/jq-zsh-plugin
# Call with `jazz <big_file_with_many_paths>.json` or `<command producing a valid json> | jazz`
# End command with `... | pbcopy` or `... > output.json` to save selection
input=$1
TMP_DIR=$(mktemp -d /tmp/jazz_XXX)
chmod 700 "$TMP_DIR"