Skip to content

Installation

Fx is a powerful tool that comprises two primary components: a terminal JSON viewer and a JSON processor. The terminal JSON viewer is developed in Go and functions independently without the need for additional runtime dependencies. On the other hand, if you prefer the command-line JSON processor, which is designed in JavaScript, ensure that you have either Node.js or Deno installed.

Full Installation

Depending on your system or preferences, use one of the following methods:

sh
brew install fx
brew install fx
sh
snap install fx
snap install fx
sh
scoop install fx
scoop install fx
sh
pacman -S fx
pacman -S fx
sh
pkg install fx
pkg install fx
sh
go install github.com/antonmedv/fx@latest
go install github.com/antonmedv/fx@latest
sh
docker run -it --rm -v .:/data:ro antonmedv/fx file.json
docker run -it --rm -v .:/data:ro antonmedv/fx file.json

Binary Download

For a straightforward download of the latest binary, visit the GitHub releases page. Alternatively, execute the following command in your terminal:

sh
curl https://fx.wtf/install.sh | sh
curl https://fx.wtf/install.sh | sh

Installation on Windows

For Windows users:

Install Go and run the following command:

sh
go install github.com/antonmedv/fx@latest
go install github.com/antonmedv/fx@latest

Autocomplete

To enable autocompletion, add the following line to your .bashrc or .zshrc:

sh
source <(fx --comp bash)
source <(fx --comp bash)
sh
source <(fx --comp zsh)
source <(fx --comp zsh)
sh
fx --comp fish | source
fx --comp fish | source

Supported shells include bash, zsh, and fish.

GitHub Actions

In a CI environment, fx can be implemented with the following command:

sh
curl ... | npx fx .field
curl ... | npx fx .field

The npm variant of fx is compact and doesn't need additional dependencies.

Node & Deno

sh
npm install -g fx
npm install -g fx
sh
deno install -A npm:fx
deno install -A npm:fx

Note

Remember, the JavaScript iteration of fx operates in a non-interactive mode. It solely offers JSON processing functionalities.