jo
creates JSON from shell arguments
TLDR
Create JSON object
$ jo name=[value] count:=[42]
Create JSON arraycopy
$ jo -a [item1] [item2] [item3]
Nested objectscopy
$ jo name=[test] config=$(jo debug:=[true])
Read from stdincopy
$ echo "[value]" | jo name=@-
Read from filecopy
$ jo content=@[file.txt]
Pretty printcopy
$ jo -p name=[value]
copy
SYNOPSIS
jo [options] [key=value...]
DESCRIPTION
jo creates JSON from shell arguments. It builds objects and arrays from command-line key-value pairs.The tool enables JSON generation in shell scripts. Type hints distinguish strings from numbers and booleans.
PARAMETERS
KEY=VALUE
String value assignment.KEY:=VALUE
Non-string value (number, boolean, null).-a
Create array instead of object.-p
Pretty print output.@FILE
Read value from file.@-
Read value from stdin.--help
Display help information.
CAVEATS
Shell quoting important. Use := for non-strings. Nested structures via subshell.
HISTORY
jo was created by Jan-Piet Mens to simplify JSON creation in shell scripts without complex quoting.