Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

jsonpath

Extract values from JSON without learning jq.

What it does

Takes a simple dot-notation path and returns the value from JSON.

jsonpath user.address.city data.json
# → "Berlin"

Why it exists

jq is powerful but overkill for 90% of use cases. You just want a value, not a query language.

Installation

curl -fsSL https://raw.githubusercontent.com/goallthepath/jsonpath/main/jsonpath -o /usr/local/bin/jsonpath
chmod +x /usr/local/bin/jsonpath

Or clone and use directly:

git clone https://github.com/goallthepath/jsonpath.git
./jsonpath/jsonpath user.name data.json

Usage

# From file
jsonpath user.name data.json

# From stdin
cat data.json | jsonpath user.name

# Nested paths
jsonpath users.0.email data.json

# Returns objects too
jsonpath user.address data.json
# → {"city": "Berlin", "zip": "10115"}

Examples

# Extract API key from config
curl -s api.example.com/config | jsonpath api.key

# Get first item from array
cat users.json | jsonpath users.0.name

# Deep nesting
cat data.json | jsonpath company.departments.0.employees.2.email

Philosophy

Tools should be obvious. No flags, no syntax, no docs to read.

License

MIT


Built with Builder-Agent

About

Extract values from JSON using simple dot notation — no jq required

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages