This is an old revision of the document!
jo
A command-line utility for generating JSON text from its arguments, with a name almost as questionable as jq.
Usage
jo foo=42 bar=69
# -> {"foo": 42, "bar": 69}
jo point[x]=32 point[y]=64
# or
jo point=$(jo x=32 y=64)
# -> {"point": {"x": 32, "y": 64}}
jo numbers[]=1 numbers[]=2 numbers=3
# or
jo numbers=$(jo -a 1 2 3)
# -> {"numbers": [1, 2, 3]}
jo -- bool@t otherbool=false empty= -s notbool=true
# -> {"bool": true, "otherbool": false, "empty": null, "notbool": "true"}
Resources
-
man page (slightly out of date)