fx - Interactive JSON Explorer

Overview

fx is a terminal JSON viewer with interactive navigation. Use it to explore unknown JSON structures before writing jq queries.

fx is for exploration, jq is for work.

  • fx → "What’s in this JSON?"

  • jq → "Extract/transform this data"

You’ll use jq 95% of the time. fx is for discovery.

Installation

# Arch Linux
sudo pacman -S fx

# Homebrew
brew install fx

# Go
go install github.com/antonmedv/fx@latest

# npm
npm install -g fx

Quick Start

# Pipe JSON to fx
curl -s https://api.github.com/users/torvalds | fx

# From file
fx data.json

# From command output
kubectl get pods -o json | fx
hostnamectl --json=short | fx

Navigation

Key Action

j k

Move up/down

l Enter

Expand node

h

Collapse node

e

Expand all

E

Collapse all

/

Search

n N

Next/previous search result

p

Print path to current node

y

Copy current value

q Ctrl+C

Quit

Workflow: fx → jq

Step 1: Explore with fx

# Unknown API response - what's in here?
netapi ise --format json get-policy-sets | fx

Navigate to the data you need, press p to print the path:

.response[0].name

Step 2: Extract with jq

# Now you know the path
netapi ise --format json get-policy-sets | jq -r '.response[0].name'

Practical Examples

Vault API

# Explore PKI certificate response
vault write -format=json pki_int/issue/domus-client common_name="test" | fx

# Navigate to .data.certificate, press 'p' → ".data.certificate"
# Now use jq:
vault write -format=json pki_int/issue/domus-client common_name="test" | jq -r '.data.certificate'

Kubernetes

# Explore pod structure
kubectl get pod mypod -o json | fx

# Find container image path, then:
kubectl get pod mypod -o json | jq -r '.spec.containers[0].image'

hostnamectl

# Explore available fields
hostnamectl --json=short | fx

# Discover keys like StaticHostname, OperatingSystemPrettyName, etc.

ISE API

# Explore authorization profile structure
netapi ise --format json get-authz-profiles | fx

# Find dACL field path, then extract:
netapi ise --format json get-authz-profiles | jq '.[] | {name, dacl: .daclName}'

fx vs jq vs yq

Feature fx jq yq

Interactive

Scripting

Transformations

JSON

YAML

Pipelines

Learning curve

Low

Medium

Medium

Tips

Copy Path Directly

Press p while on a node to print the jq-compatible path:

.data.items[0].metadata.name

Copy this directly into your jq query.

Search Large Structures

Press / and type to search. Useful for finding specific keys in deeply nested JSON.

Reduce Before Exploring

If JSON is huge, reduce first:

# First 5 items only
curl -s "$API" | jq '.[0:5]' | fx

When NOT to Use fx

  • Scripting/automation → use jq

  • Pipelines → use jq

  • YAML files → use yq

  • Extracting values → use jq

  • CI/CD → use jq

fx is human-interactive only. No scripting capability.

See Also