LinuxCommandLibrary

jf

Execute commands from JSON/YAML files

TLDR

Add a new configuration

$ jf config add
copy

Show the current configuration
$ jf config show
copy

Search for artifacts within the given repository and directory
$ jf rt search --recursive [repostiory_name]/[path]/
copy

SYNOPSIS

jf [options] <jsonpath> [file ...]

PARAMETERS

-h, --help
    Show help message and exit

-v, --version
    Show version number and exit

-r, --raw
    Output strings without quotes

-c, --color
    Colorize output (default on TTY)

-u, --unique
    Output only unique values

-p, --pretty
    Pretty-print JSON results

-s, --slurp
    Slurp stdin into a JSON array

-n, --null
    Output null for empty results

-e ERROR, --error=ERROR
    Custom error message format

-o OUTPUT, --output=OUTPUT
    Output format: text, json, or tsv

DESCRIPTION

jf is a fast, minimal command-line tool for extracting and processing JSON data using JSONPath expressions. Designed as a lightweight alternative to jq, it reads JSON from files or stdin, applies the specified JSONPath query, and outputs results efficiently.

It supports navigating complex nested structures, arrays, and objects with standard JSONPath syntax like $.store.book[0].author. Output can be customized for raw strings, colors, uniqueness, or formats like JSON/TSV. Ideal for scripting, API parsing, log analysis, and data pipelines where speed matters over extensive filtering features.

Written in Rust for performance, jf handles large inputs quickly and integrates seamlessly with shell commands via pipes.

CAVEATS

Not as feature-complete as jq; limited to JSONPath (no advanced filters/functions). Requires separate installation (e.g., cargo install jf). Strict JSON input validation.

EXAMPLE

echo '{"name":"Alice","age":30}' | jf '.name'
Output: Alice

cat data.json | jf '$.items[*].id' -u

INSTALLATION

Via Cargo: cargo install jf
Or from GitHub releases.

HISTORY

Developed by Paul Sibson in 2018 as a Rust-based, high-performance jq alternative using JSONPath. Actively maintained on GitHub with focus on speed for large datasets.

SEE ALSO

jq(1), gron(1), jless(1)

Copied to clipboard