All Projects → sanity-io → groq-cli

sanity-io / groq-cli

Licence: MIT License
Run GROQ in your command line

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to groq-cli

Dictfier
Python library to convert/serialize class instances(Objects) both flat and nested into a dictionary data structure. It's very useful in converting Python Objects into JSON format
Stars: ✭ 67 (-51.8%)
Mutual labels:  json-api, json-parser
json
a portable, powerful and pure functional JSON library for Scheme
Stars: ✭ 40 (-71.22%)
Mutual labels:  json-api, json-parser
JSONinSV
JSON lib in Systemverilog
Stars: ✭ 25 (-82.01%)
Mutual labels:  json-api, json-parser
Mojojson
A simple and fast JSON parser.
Stars: ✭ 271 (+94.96%)
Mutual labels:  json-api, json-parser
xijs
A business - oriented scene Js Library
Stars: ✭ 91 (-34.53%)
Mutual labels:  json-api, json-parser
format-to-json
An algorithm that can format a string to json-like template. 字符串JSON格式化的算法。
Stars: ✭ 30 (-78.42%)
Mutual labels:  json-api, json-parser
whc-json-to-class
javascript版本json自动转换生成对应语言模型类The whc-json-to-class is the javascript plug-in that automatically converts the json string to the corresponding language model class
Stars: ✭ 24 (-82.73%)
Mutual labels:  json-api, json-parser
jqtop
Analyze json logs in realtime
Stars: ✭ 14 (-89.93%)
Mutual labels:  json-parser
BetterMappable
Better Mappable through Property Wrappers using ObjectMapper
Stars: ✭ 26 (-81.29%)
Mutual labels:  json-parser
JSONCustomLintr
Library to allow creation, running, and reporting of custom lint rules for JSON files
Stars: ✭ 19 (-86.33%)
Mutual labels:  json-api
basic-transport-info-app
A progressive web app to show direct & indirect buses / transport between two places / cities / stops .Show next schedule & travel duration. Algorithm to calculate indirect buses on basis of their schedule time. Voice search . Locate nearest city/stop by gps. Bus timetable.
Stars: ✭ 12 (-91.37%)
Mutual labels:  json-api
jsonapi-deserializable
Conveniently deserialize JSON API payloads into custom hashes.
Stars: ✭ 23 (-83.45%)
Mutual labels:  json-api
learn-xquery
A list of great articles, blog posts, and books for learning XQuery
Stars: ✭ 33 (-76.26%)
Mutual labels:  query-language
typeql
TypeQL: the query language of TypeDB - a strongly-typed database
Stars: ✭ 157 (+12.95%)
Mutual labels:  query-language
ctuning-datasets-min
Public data sets and their properties in the Collective Knowledge Format with JSON API and JSON meta information to be easily pluggable to customizable and reproducible CK experimental workflows (such as collaborative program analysis and optimization):
Stars: ✭ 26 (-81.29%)
Mutual labels:  json-api
go-respond
A Go package for handling common HTTP JSON responses.
Stars: ✭ 45 (-67.63%)
Mutual labels:  json-api
motis
Intermodal Mobility Information System
Stars: ✭ 45 (-67.63%)
Mutual labels:  json-api
Perfect-JSON-API
An Example JSON API for Perfect
Stars: ✭ 43 (-69.06%)
Mutual labels:  json-api
JPStream
JPStream: JSONPath Stream Processing in Parallel
Stars: ✭ 19 (-86.33%)
Mutual labels:  json-parser
jackson
Pythonic way of keeping secrets secure in JSON
Stars: ✭ 17 (-87.77%)
Mutual labels:  json-parser

groq-cli

Currently in alpha.

Easy wrangling of JSON documents with GROQ in the command line.

The CLI tool consumes both JSON and NDJSON documents. You can pass in data from a local file, or from piping to standard input.

Read the announcement blog post, and the getting started guide.

Install

npm install --global groq-cli

Requirements

This CLI requires Node v10 or later.

Usage

$ groq --help
  Run GROQ in the command line

  Usage
    $ groq '*[<filter>]{<projection>}'
    # Remember to alternate quotation marks inside of the query

  Options
    -i, --input   One of: ndjson, json, null
    -o, --output  One of: ndjson, json, pretty
    -p, --pretty  Shortcut for --output=pretty
    -n, --ndjson  Shortcut for --input=ndjson --output=ndjson

  Input formats
    json      Reads a JSON object from stdin.
    ndjson    Reads a JSON stream from stdin.
    null      Reads nothing.

  Output formats
    json      Formats the output as JSON.
    pretty    Formats the output as pretty JSON.
    ndjson    Streams the result as NDJSON.

  Examples
    # Query data in a file
    $ cat blog.json | groq 'count(posts)'

    # Query data in a NDJSON file
    $ cat blog.ndjson | groq --input ndjson '*[_type == "post"]{title}'

    # Query JSON data from an URL
    $ curl -s https://jsonplaceholder.typicode.com/todos | groq  --pretty '*[completed == false]{title}'

Similar tools

GROQ-cli isn't the only tool to work with JSON data in the command line. If it doesn't do exactly what you need, you can check out these other tools that might help you:

  • jq — a lightweight and flexible command-line JSON processor.
  • gron - Make JSON greppable!

License

MIT – Copyright 2019–present Sanity Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].