Installation
Depending on your system or preferences, use one of the following methods:
sh
brew install fxsh
snap install fxsh
scoop install fxsh
pacman -S fxsh
pkg install fxsh
go install github.com/antonmedv/fx@latestsh
docker run -it --rm -v .:/data:ro antonmedv/fx file.jsonsh
nix-shell -p fxBinary Download
Download the latest binary from the GitHub releases page. Or execute the following command:
sh
curl https://fx.wtf/install.sh | shThe 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@latestAutocomplete
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' saveThe npm variant of fx is compact and doesn't need additional dependencies.
Node & Deno
sh
npm install -g fxsh
deno install -A npm:fxNote
Remember, the JavaScript version of fx operates only in a non-interactive mode. It offers JSON processing functionality only.