I stumbled upon one of the best Command Line JSON processing tools and Viewer, named fx. This tool is written in Node.js and distributed as a single binary without external dependencies. It is designed to give you a nice view and navigation of JSON files.
Features of fx JSON Viewer
To name a few, here are the core features of fx command line json processing tool.
- It is easy to use
- Distributed as standalone binary
- You operate it in interactive mode
- Has support for themes to give it a nice look
- Bash completion support – more productivity
- Fx has streaming support
Install fx from a standalone binary
The easiest installation method is from a standalone binary. Check the fx downloads page for available releases.
Download binary for Linux
wget https://github.com/antonmedv/fx/releases/download/14.0.1/fx-linux.zip unzip fx-linux.zip sudo mv fx-linux /usr/local/bin/fx
For Mac users, you can use Homebrew or binary.
wget https://github.com/antonmedv/fx/releases/download/14.0.1/fx-macos.zip unzip fx-macos.zip sudo mv fx-macos /usr/local/bin/fx # Homebrew installation $ brew install fx
Install fx using npm
If you choose to go with npm installation method, install Node.js on your system using our guide below.
Thereafter, install fx using below command.
$ npm install -g fx
How to use fx JSON command line viewer
fx can work in two modes: cli and interactive. To start interactive mode pipe into fx any JSON:
$ curl ... | fx
You can also pass file argument as first parameter. fx will apply it and prints to stdout.
$ fx myfile.json
Click on fields to expand or collapse JSON tree, use mouse wheel to scroll view.
Read fx documentation to learn about all fx operation modes and see more examples which could work for your use case.
Knowledge is the voice you need to break through the IT sphere, this is what will get you started.