Skip to content
jc-rs
GitHub

v0.5.1

Install

Every channel is cut from the same git tag by one workflow. Nothing is built by hand.

Cargo, prebuilt

$ cargo binstall jc-rs

Cargo, from source

$ cargo install jc-rs

Homebrew

$ brew install OlegSotnikov/tap/jc-rs

Docker

$ docker pull appmasterio/jc-rs

npm, WebAssembly

$ npm install jc-rs-wasm

The binary is jc-rs, not jc

Release archives carry a jc alias, and nothing installs it for you. Dropping a second jc into PATH would shadow the original, which is somebody else's tool and the authority this one is measured against. Enable it deliberately or not at all.

Container

A compact scratch image contains the binary and its licence, with no shell, no libc and no package manager. linux/amd64 and linux/arm64 ship in one manifest, so docker pull picks the right one.

ps aux | docker run --rm -i appmasterio/jc-rs --ps | jq '.[0]'
tail -f access.log | docker run --rm -i appmasterio/jc-rs -u --clf-s

Magic syntax (jc-rs df -h) needs the command inside the container, and this image deliberately has nothing else in it. Pipe instead, or use the standalone binary.

Shell completions

jc-rs -B > /etc/bash_completion.d/jc-rs
jc-rs -Z > "${fpath[1]}/_jc-rs"
jc-rs -F > ~/.config/fish/completions/jc-rs.fish

As a library

The parsers are their own crate. Parsers register themselves at link time, so depending on jc-rs-parsers is what fills the registry.

let output = jc_rs_parsers::parse("df", df_output)?;

// Streaming parsers hand back a session you feed a line at a time.
let mut session = jc_rs_parsers::session("clf_s").unwrap();
for line in reader.lines() {
    if let Some(record) = session.parse_line(&line?, true)? {
        handle(record);
    }
}

The same parsers compile to WebAssembly (jc-rs-wasm), which is what runs the converter on this site's front page.