# jo

> Command-line utility to create JSON objects and arrays from shell arguments and piped input

Stars: 4.9k · Language: C · License: GPL-2.0 · Categories: Data

- Repository: https://github.com/jpmens/jo
- Website: http://jpmens.net/2016/03/05/a-shell-command-to-create-json-jo/
- Page: https://www.trmn.sh/tools/jo

## Install

- Homebrew: `brew install jo`
- Ubuntu: `apt-get install jo`
- Fedora: `dnf install jo`

## Overview

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.

### Installation

```bash
# via Homebrew
brew install jo
```

```bash
# via Ubuntu
apt-get install jo
```

```bash
# via Fedora
dnf install jo
```

## Alternatives

- [jq](https://www.trmn.sh/tools/jq.md): Command-line JSON processor for slicing, filtering, mapping and transforming structured data (C, 36.0k stars)
- [youplot](https://www.trmn.sh/tools/youplot.md): Command-line tool that generates Unicode plots from CSV/TSV data directly in the terminal (Ruby, 4.9k stars)
- [lazysql](https://www.trmn.sh/tools/lazysql.md): Cross-platform TUI database management tool for MySQL, PostgreSQL, SQLite, and MSSQL with SQL editor and table operations. (Go, 4.4k stars)
- [jless](https://www.trmn.sh/tools/jless.md): Command-line JSON viewer with syntax highlighting, collapsible sections, and vim-inspired navigation commands (Rust, 5.5k stars)
- [csvlens](https://www.trmn.sh/tools/csvlens.md): Terminal CSV file viewer with spreadsheet-like navigation and filtering capabilities (4.0k stars)

---

Canonical: https://www.trmn.sh/tools/jo
