Skip to content

Installation ​

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

sh
brew install fx
sh
snap install fx

# The snap is strictly confined: it reads files under your home directory only.
# To open files on mounted drives (`/media`, `/mnt`, `/run/media`), connect the
# removable-media interface once:
# 
#     sudo snap connect fx:removable-media
# 
# For files elsewhere, such as `/etc` or `/var`, pipe them in:
# 
#     sudo cat /etc/foo.json | fx
# 
# ":w !cmd" runs inside the snap too, so it can't reach your shell or
# the tools installed on your system. Use another install method if you need it.
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 the 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 offers JSON processing functionality only.