#pretty #log #parse #parser

app kras

Detect, highlight and pretty print almost any structured data inside plain text

22 releases

0.5.0 Feb 12, 2023
0.4.4 Oct 14, 2022
0.4.1 Dec 2, 2021
0.4.0 Nov 22, 2021
0.1.1 Jul 29, 2020

#139 in Value formatting

Download history 6/week @ 2024-02-21 6/week @ 2024-02-28 16/week @ 2024-03-13 26/week @ 2024-03-27 52/week @ 2024-04-03

78 downloads per month

MIT license

1.5K SLoC


kras - Detect, highlight and pretty print structured data

This tool can find structured data of any kind inside of plain string, parse it and pretty-print it:

It can detect and parse almost any kind of data:

and probably many more. Don't hesitate to open an issue if your data wasn't processed correctly


    kras [FLAGS] [OPTIONS] [input]...

        --debug          debug mode
    -C, --force-color    alias for --color yes
    -h, --help           Prints help information
    -m, --multiline      look for data spanning several lines. This will read whole input to memory
    -r, --recursive      try to parse nested strings
        --robust         use more robust, but slower method to detect structured data
    -s, --sort           sort keys
    -V, --version        Prints version information

    -c, --color <color>      colorize output [default: auto]  [possible values: yes, no, auto]
    -i, --indent <indent>    indentation. 0 to disable (colorization is stil performed) [default: 2]
    -j <jobs>                number of parallel jobs. Default is num_cpus
    -w, --width <width>      maximum width of output [default: 80]

    <input>...    Input files or stdin

Using with pgcli

kras really shines when used for reading jsons stored in database. For pgcli add to your .config/pgcli/config

pager = kras -Csw120 | less -iRXF

Now your jsons will be pretty-printed! Hint: use \x


This tool is powered by these amazing libs: pom for parsing and pretty for pretty-printing


The name kras comes from russian root крас- - a beginning of words such as красивый (pretty), красный (red) and красить (to paint). That's what this app does: makes data pretty and paints it red (but not only red)


~191K SLoC