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:
brew install fx
brew install fx
snap install fx
snap install fx
scoop install fx
scoop install fx
pacman -S fx
pacman -S fx
pkg install fx
pkg install fx
go install github.com/antonmedv/fx@latest
go install github.com/antonmedv/fx@latest
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:
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:
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
:
source <(fx --comp bash)
source <(fx --comp bash)
source <(fx --comp zsh)
source <(fx --comp zsh)
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:
curl ... | npx fx .field
curl ... | npx fx .field
The npm variant of fx
is compact and doesn't need additional dependencies.
Node & Deno
npm install -g fx
npm install -g fx
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.