explaingit

kellyjonbrazil/jc

8,606PythonAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool and Python library that converts the plain-text output of over a hundred Unix commands into clean, structured JSON you can filter and process programmatically.

Mindmap

mindmap
  root((jc))
    What it does
      Parse command output
      Convert to JSON
      100 plus parsers
    Usage
      Shell pipeline
      Python library
      Ansible plugin
    Install options
      pip
      Homebrew
      Prebuilt binary
    Use cases
      Shell automation
      Config management
      Data processing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Parse the output of commands like ping, ps, or ifconfig in a shell script without writing custom text parsers.

USE CASE 2

Feed structured command output into Ansible or SaltStack automation tasks that expect typed data.

USE CASE 3

Build a monitoring script that runs netstat and processes the results as JSON with jq.

USE CASE 4

Import jc as a Python library to programmatically parse command output inside automation tools.

Tech stack

PythonpipHomebrewAnsible

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

jc is a command-line tool and Python library that takes the text output of common Unix/Linux commands and converts it into structured JSON. Many standard tools like dig, ping, ls, ps, ifconfig, netstat, and dozens of others print their results as plain text designed for human reading, not machine processing. jc acts as a translator sitting between those commands and anything that needs to process the data programmatically. The typical usage is to pipe a command's output through jc in a shell pipeline. For example, running a DNS lookup and piping it through jc produces a clean JSON object with all the fields labelled and typed correctly. From there you can pipe it into tools like jq to filter or transform the data. jc also supports a shorthand syntax where you write jc in front of the original command rather than piping through it. Beyond the command-line tool, jc works as an importable Python library. You pass a string of command output into the parse function along with the name of the parser, and you get back a Python dictionary or list of dictionaries. This is useful when automating tasks with Ansible, SaltStack, or other configuration management tools that run commands and need to inspect the results. jc ships parsers for well over a hundred different commands and file formats. Each parser has a documented schema so you know exactly what fields to expect in the output. There is also a raw output mode that skips some of the type conversion and returns the data closer to its original form. The project is available as a Python package installable via pip, through package managers on most major Linux distributions and macOS via Homebrew, and as standalone precompiled binaries. It also appears as an Ansible filter plugin in the community.general collection. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to use jc to parse the output of `netstat -r` into JSON and extract the default gateway.
Prompt 2
Write a Python script that uses jc to parse `ps aux` output and find all processes using more than 100MB of RAM.
Prompt 3
How do I use jc in an Ansible playbook to run `df -h` and assert that disk usage is below 80%?
Prompt 4
Give me a shell one-liner using jc and jq to list the five largest files from `ls -la` output.
Open on GitHub → Explain another repo

← kellyjonbrazil on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.