Fx
Command-line tool and terminal JSON viewer ?
Under MIT License
By antonmedv
Command-line tool and terminal JSON viewer ?
Under MIT License
By antonmedv
* Function eXecution
Command-line JSON processing tool
bash
npm install -g fx
Or via Homebrewbash
brew install fx
Or download standalone binary from releases
Start interactive mode without passing any arguments.bash
$ curl ... | fx
Or by passing filename as first argument.bash
$ fx data.json
Pass a few JSON files.bash
cat foo.json bar.json baz.json | fx .message
Use full power of JavaScript.bash
$ curl ... | fx '.filter(x => x.startsWith("a"))'
Access all lodash (or ramda, etc) methods by using .fxrc file.bash
$ curl ... | fx '_.groupBy("commit.committer.name")' '_.mapValues(_.size)'
Update JSON using spread operator.bash
$ echo '{"count": 0}' | fx '{...this, count: 1}'
{
"count": 1
}
Extract values from maps.bash
$ fx commits.json | fx .[].author.name
Print formatted JSON to stdout.bash
$ curl ... | fx .
Pipe JSON logs stream into fx.bash
$ kubectl logs ... -f | fx .message
And try this:bash
$ fx --life
See full documentation.
MIT