LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jo

creates JSON from shell arguments

TLDR

Create JSON object
$ jo name=[value] count:=[42]
copy
Create JSON array
$ jo -a [item1] [item2] [item3]
copy
Nested objects
$ jo name=[test] config=$(jo debug:=[true])
copy
Read from stdin
$ echo "[value]" | jo name=@-
copy
Read from file
$ jo content=@[file.txt]
copy
Pretty print
$ 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.

INSTALL

sudo apt install jo
copy
sudo dnf install jo
copy
sudo pacman -S jo
copy
sudo apk add jo
copy
sudo zypper install jo
copy
brew install jo
copy
nix profile install nixpkgs#jo
copy

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.

SEE ALSO

jq(1), jc(1), gron(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid