4

Chromaterm — Enhance your SSH sessions with useful Syntax Highlighting!

 10 months ago
source link: https://medium.com/@stewalexander/chromaterm-turns-cli-ssh-sessions-from-ordinary-to-extraordinary-be8348e467b2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Chromaterm — Enhance your SSH sessions with useful Syntax Highlighting!

Chromaterm adds thoughtful syntax highlighting to any command output, including to entire ssh sessions to remote systems like Cisco IOS Switches

1*DA5xgfm1aFKOsxKhrQIgHA@2x.jpeg

What is it?

It’s a Python app that takes the output of any CLI / terminal command (including ssh); applies a sophisticated regex filter to it that highlights certain key words, or numbers, with a different color; and displays this to the user (i.e. you)

Why use this?

CLI / terminal output, especially say from a network switch, or log, is often information dense; using Chromaterm’s syntax highlighting can assist pointing out key details (see the highlighted ifconfig output in the above pic for a brief idea) and it helps to “break up” long strings of output making it easier to read and comprehend.

How to use it?

This app requires a relatively new version of Python (a programming language), which is increasingly installed by default on many systems, especially development machines.

If you’re not sure Python is installed, in the Linux CLI (or the Mac Terminal app under Applications -> Utilities) type

which python3

This should tell you where it is installed, if it is.

Otherwise you’ll need to install Python version 3.x or later, many ways to do this, but the easiest by far is via package managers such as Homebrew for the Mac, Chocolatey or Scoop The PC, or Apt (etc) for Linux distros like Ubuntu (see the links for further information / how to install these tools)

Once Python is installed make sure its package tool “Pip” (or pip3 truly) is installed (seethisfor details), and type / copy this to the command prompt

pip3 install chromaterm

Once ChromaTerm is installed, just add “ct” to the front of a command or ssh input, like so

ct ssh [email protected]

If you want to colorize any ssh session, you can create an alias in the .bashrc file (or etc) like so

alias ssh=“ct ssh”

Then execute the bash resource configuration via

. ~/.bashrc

(There needs to be a single space between the “.” and ~/.bashrc bits, by the way)

This will colorize any ssh session via the typical ssh command like this

ssh [email protected]

One can also put the “ct” in front of any command, such as ifconfig, to colorize its output

ct ifconfig 

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK