Command-line utility to create JSON objects and arrays from shell arguments and piped input
jo is a command-line utility that creates JSON objects and arrays from shell arguments and standard input. It accepts key-value pairs as arguments to generate JSON objects, automatically inferring data types for strings, numbers, and booleans. For example, jo name=test n=42 active=true produces a JSON object with appropriate typing.
The tool also creates JSON arrays from piped input using the -a flag. Commands like seq 1 5 | jo -a convert line-based input into JSON array format. This makes jo particularly useful for shell scripting, data transformation pipelines, and integrating command-line tools with JSON-based APIs or configuration systems.
jo is implemented in C and available across multiple platforms including Linux distributions, macOS, FreeBSD, OpenBSD, and Windows. It includes comprehensive package manager support and passes tests on various Unix-like systems including AIX. The tool focuses specifically on JSON generation rather than parsing, filling a common gap in shell-based data processing workflows.
# via Homebrew
brew install jo
# via Ubuntu
apt-get install jo
# via Fedora
dnf install jo