A terminal JSON viewer and processor
open sourceMITself-hostablefree
fx is a CLI for JSON: it shows JSON interactively in your terminal and transforms it with JavaScript. Pipe JSON into it (even curl -i output with headers) to explore it with arrow or Vim keys, fuzzy-search paths and run queries that update as you type, with autocomplete. Arguments are JavaScript functions applied in turn (fx data.json '.users.map(x => x.name)'), run by the embedded goja engine, with shorthand like .name and built-in functions. It streams line-delimited and concatenated JSON, can slurp a stream into an array, and also reads YAML, TOML, EDN, XML, HTML and MAML. It is a single Go binary with shell completion for bash, zsh and fish, installed from Homebrew, Snap, Scoop, pacman, FreeBSD pkg, Go, Docker or Nix.
Problems it solves
- explore a large JSON API response interactively in the terminal
- transform JSON on the command line with JavaScript instead of learning jq syntax
- pretty-print and navigate JSON logs in the terminal
- query YAML or TOML files from the terminal
- process a stream of line-delimited JSON records
Features
- interactive JSON viewer with arrow and Vim keys
- live query input with autocomplete
- fuzzy search of JSON paths
- JavaScript functions as arguments, with built-in functions
- streaming of line-delimited and concatenated JSON, and --slurp
- YAML, TOML, EDN, XML, HTML and MAML input
- shows curl headers in interactive mode
- shell completion for bash, zsh and fish
- single Go binary
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what fx does.
