jc is a command-line tool and Python library that converts the output of popular CLI tools, file types, and common strings into JSON, YAML, or Python dictionaries.
The tool solves the problem of parsing unstructured command-line output by automatically converting it to structured data formats. This enables piping output to JSON query tools like jq for further processing, and simplifies automation scripts by eliminating manual parsing logic. The approach works through a collection of specialized parsers, each designed to handle specific commands or file formats, with support for both strict schema-based conversion and raw pre-processed output modes.
The tool suits developers and system administrators who write shell scripts, Ansible playbooks, or Python automation code and need to extract data from command output. It is particularly valuable in environments where multiple CLI tools are chained together, as it allows structured data to flow between them. The project integrates with existing ecosystems through an Ansible filter plugin and offers a web demo and REST API for experimentation. The README references related projects like libxo on FreeBSD and PowerShell's ConvertTo-Json, positioning jc as a Unix-philosophy approach to structured output.
The project maintains active development with regular releases documenting changes and improvements. The codebase includes comprehensive documentation for each parser with defined schemas, and the tool is available as both a command-line utility and a Python package with support for streaming parsers that return lazy iterables for memory-efficient processing of large datasets.