All Projects → SignorMercurio → limner

SignorMercurio / limner

Licence: MIT License
Limner colorizes and transforms CLI outputs.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to limner

Rdoc
colourised R docs in the terminal
Stars: ✭ 49 (-50.51%)
Mutual labels:  colorization
Colorization
Automatic colorization using deep neural networks. "Colorful Image Colorization." In ECCV, 2016.
Stars: ✭ 2,791 (+2719.19%)
Mutual labels:  colorization
awesome print.cr
It dreams about becoming ruby's awesome_print for crystal-lang, under light development.
Stars: ✭ 13 (-86.87%)
Mutual labels:  colorization
Comicolorization
This is the implementation of the "Comicolorization: Semi-automatic Manga Colorization"
Stars: ✭ 99 (+0%)
Mutual labels:  colorization
Colorizing With Gans
Grayscale Image Colorization with Generative Adversarial Networks. https://arxiv.org/abs/1803.05400
Stars: ✭ 209 (+111.11%)
Mutual labels:  colorization
colnet
🖌️ Automatic Image Colorization with Simultaneous Classification – based on "Let there be Color!"
Stars: ✭ 37 (-62.63%)
Mutual labels:  colorization
Rainbow
Ruby gem for colorizing printed text on ANSI terminals
Stars: ✭ 683 (+589.9%)
Mutual labels:  colorization
zsh-ls-colors
A zsh library to use LS_COLORS
Stars: ✭ 23 (-76.77%)
Mutual labels:  colorization
Interactive Deep Colorization
Deep learning software for colorizing black and white images with a few clicks.
Stars: ✭ 2,465 (+2389.9%)
Mutual labels:  colorization
video-colorization
Applying the machine learning tool "DeOldify" on videos, frame by frame.
Stars: ✭ 15 (-84.85%)
Mutual labels:  colorization
Chromagan
Official Implementation of ChromaGAN: An Adversarial Approach for Picture Colorization
Stars: ✭ 117 (+18.18%)
Mutual labels:  colorization
Automatic Image Colorization
🎨 Automatic Image Colorization using TensorFlow based on Residual Encoder Network
Stars: ✭ 130 (+31.31%)
Mutual labels:  colorization
external-internal-inpainting
[CVPR 2021] EII: Image Inpainting with External-Internal Learning and Monochromic Bottleneck
Stars: ✭ 95 (-4.04%)
Mutual labels:  colorization
Ansi Econsole
Eclipse plugin that understands ANSI escape sequences to color the Eclipse console output.
Stars: ✭ 72 (-27.27%)
Mutual labels:  colorization
MetalColor
Automatic Real Time Colorization with CNN on iOS
Stars: ✭ 69 (-30.3%)
Mutual labels:  colorization
Coloring Greyscale Images
Coloring black and white images with deep learning.
Stars: ✭ 767 (+674.75%)
Mutual labels:  colorization
vim-modusline
🌈 Mode-specific statusline colors
Stars: ✭ 39 (-60.61%)
Mutual labels:  colorization
Awesome-Deep-Colorization
Selected Paper List of Deep Model based Image Colorization
Stars: ✭ 62 (-37.37%)
Mutual labels:  colorization
iconcolor
Automatic icon colorization using deep convolutional neural networks. "Towards Icon Design Using Machine Learning." In Stanford CS229, Fall 2017.
Stars: ✭ 35 (-64.65%)
Mutual labels:  colorization
go-rainbow
Golang Helper for beautiful CLI Applications
Stars: ✭ 86 (-13.13%)
Mutual labels:  colorization

Limner

Limner colorizes and transforms CLI outputs.

English | 简体中文

Motivation

When playing with kubectl, I sometimes found it hard to extract the information I needed most from the extermely long, mono-colored output produced by the CLI. The same things happens when I'm using curl to test some REST APIs which usually return a long string of JSON.

Of course I can use GUI tools like Kubernetes Dashboard and Postman, but for simple operations that need to be performed swiftly, CLIs have their own advantages. Therefore, I made limner to bring some changes to the CLIs' output.

Installation

Download a release binary

Go to Release Page, download a release and run:

tar zxvf lm_[version]_[os]_[arch].tar.gz
cd lm_[version]_[os]_[arch]
mv ./lm_[os]_[arch] ./lm
chmod +x ./lm
[your command] | ./lm

Remember to replace the text in [].

Manual Installation

  1. You'll need Go installed.

  2. Clone the repo:

git clone https://github.com/SignorMercurio/limner.git
cd limner
go build -o lm .
  1. Run the command:
[your command] | ./lm

Note: It's strongly recommended to add the binary to your $PATH, e.g. /usr/local/bin.

Usage

Basic Usage

In most cases, you don't need to append any arguments when using limner as it automatically detects the format of the output.

Colorize tables

kubectl get po | lm

Table colorization

Colorize YAML files

kubectl describe deploy/nginx | lm

YAML colorization

Colorize JSON responses

curl -s https://api.github.com/users/SignorMercurio | lm

JSON colorization

Transform YAML to JSON

cat nginx/deploy.yml | lm tr -i yaml -o json

You can always omit -i yaml as long as the format of input is YAML (or looks like YAML). The same is true for other formats.

YAML->JSON transformation

Transform JSON to YAML

curl -s https://jsonplaceholder.typicode.com/users/1/albums | lm tr -o yml

JSON->YAML transformation

Note: Limner is only designed for dealing with outputs. Do not use it with commands that need to receive input from stdin.

TODO: Add support for more formats and transformation between different formats.

Create a shortcut

Take kubectl as an example.

Bash

Suppose you've already configured autocompletion for kubectl (Optional).

In your .bash_profile or .bashrc, append the following lines:

function k() {kubectl $@ | lm}
complete -o default -F __start_kubectl k
alias kx="kubectl exec -it"

Zsh

Suppose you've already configured autocompletion for kubectl (Optional).

In your .zprofile or .zshrc, append the following lines:

function k() {kubectl $@ | lm}
compdef k=kubectl
alias kx="kubectl exec -it"

After the above steps, you'll be able to use kubectl with color and autocompletion like:

Using a shortcut

Non-terminal output

When you choose to output the result to a file, or pass the result to other programs, through a pipe | or redirection >, you certainly do not want limner to colorize the output. The --plain flag (or -p) is meant for this, which prevent limner from colorizing the output.

Customize color themes

You can use a config file to customize color themes. By default, limner will try to read $HOME/.limner.yaml but you can specify the config file with -c, for example:

kubectl get po | lm -c config/limner.yml

The default config file looks like:

key_color: Red
string_color: Green
bool_color: Yellow
number_color: Yellow
null_color: Cyan
header_color: Blue
column_colors:
  - White
  - Cyan

And here's an example of config file, which is suitable for a light-background terminal:

key_color: Blue
string_color: Green
bool_color: Red
number_color: Red
null_color: Cyan
header_color: Magenta
column_colors:
  - Black
  - Cyan

Possible colors include Red, Green, Yellow, Cyan, Blue, Magenta, White and Black.

Enforce types on the output

Specify -t to force limner to view the output as a specific type: YAML / JSON / table, etc. For example:

kubectl describe deploy/nginx | lm -t yaml

Note: Specifying -t yaml in kubectl describe is not necessary.

Tranformation

As you can see from the section Transform YAML to JSON, all you need is:

[something of input type] | lm -o [output type]

Use -i [input type] if you want to force the limner to view the input as a specific type.

Contributions

Any contributions are welcome. Please feel free to:

  • Open an Issue
  • Creating a Pull Request
  • Comment in an Issue / PR
  • Open a Discussion

Thank you for willing to contribute to this project!

Roadmap

  • Basic colorization
    • YAML
    • JSON
    • Tables
    • ...
  • Simple data format transformation
    • YAML <-> JSON
    • ...

If you have any suggestions for the project, please don't hesitate to open an issue or pull request.

LICENSE

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

Inspired by the following incredible projects:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].