Any recommendations for CLI tools for JSON querying? (It should be easy to install on macOS – e.g., via Homebrew.)

I’m only aware of jq. It’s established, but is it still the best choice?

@rauschma You can store JSON in a Postgres database; there's a JSON data type. Then you can do JSON-specific SQL queries. More info: https://www.postgresql.org/docs/current/datatype-json.html
8.14. JSON Types

8.14. JSON Types # 8.14.1. JSON Input and Output Syntax 8.14.2. Designing JSON Documents 8.14.3. jsonb Containment and Existence 8.14.4. jsonb …

PostgreSQL Documentation
@rauschma I also only know jq, but what I am also not looking for something else. Why do you? What's wrong with it?
@rauschma I know the AWS cli uses jmespath, you can use it in isolation here: https://github.com/jmespath/jp
GitHub - jmespath/jp: Command line interface to JMESPath - http://jmespath.org

Command line interface to JMESPath - http://jmespath.org - GitHub - jmespath/jp: Command line interface to JMESPath - http://jmespath.org

GitHub
@rauschma node & Deno are also to consider... I use them when I can't be bothered with looking up jq's doc again to figure out the name or syntax of some filter 🤣
nodejsscript/eval_print.md at main · jaandrle/nodejsscript

A tool for writing better scripts. Contribute to jaandrle/nodejsscript development by creating an account on GitHub.

GitHub
@rauschma I have not used it, but jless (https://jless.io/) looks cool and is available on homebrew.
jless - A Command-Line JSON Viewer

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.

@rauschma you could have a look at this one, a Rust based one installable with brew install jql: https://github.com/yamafaktory/jql
GitHub - yamafaktory/jql: A JSON Query Language CLI tool

A JSON Query Language CLI tool. Contribute to yamafaktory/jql development by creating an account on GitHub.

GitHub
@rauschma if you’re looking for something interactive jless is nice. https://jless.io/
jless - A Command-Line JSON Viewer

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.

@rauschma Bit of a left field answer: PowerShell

PowerShell has a lot of really interesting general purpose object query tools designed for command line use and ConvertFrom-Json and ConvertTo-Json work really moving from one object system to the other and back.

Of course, PowerShell has quite a learning curve and learning it just for JSON is silly, but the fact that its tools are generally applicable to more than just JSON can be handy.

@rauschma At @sanity_io, we’ve created a language called GROQ for querying data. We have a CLI tool that allows you to run GROQ queries for any JSON or NDJSON data. I find it to be a really expressive way to query data.

https://github.com/sanity-io/groq-cli

GitHub - sanity-io/groq-cli: Run GROQ in your command line

Run GROQ in your command line. Contribute to sanity-io/groq-cli development by creating an account on GitHub.

GitHub