Skip to content
If you find fx useful, please consider supporting me:

Sponsor
A good coffee in Zurich costs around $7 ;-)

Installation

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

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

Binary Download

Download the latest binary from GitHub releases page. Or, execute the following command:

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

The install.sh script will download the appropriate binary for your system and install it to /usr/local/bin.

Installation on Windows

For Windows users: install Go and run the following command:

sh
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)
sh
source <(fx --comp zsh)
sh
fx --comp fish | source

GitHub Actions

As GitHub Actions comes with a Node.js environment, you can use fx in your workflows via npx:

yaml
steps:
  - name: Bump version
    run: npx fx package.json 'x.version = x.version.replace(/\d+$/, n => +n + 1), x' save

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

Node & Deno

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

Note

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