Handy interactive command line cheatsheets with Cheat

(λx.x)eranga
Statuscode
Published in
2 min readFeb 22, 2017

Cheat is a tool that allows you to keep command line cheatsheets in *nix environment (macOS, Linux, etc.) You can keep track of and search frequently used commands via Cheat’s cheatsheets.

Install

The Cheat tool comes as a Python package that you can install with pip:

pip install cheat

After installing, the cheat command will be available from the command line.

Configuring Cheat

You can configure Cheat with environment variables. The following are the configs that I’m using. I have set them in my ~/.zshrc file.

# enable syntax highlighting
export CHEATCOLORS=true
# default cheat file editor(use when editing cheatsheets)
export EDITOR=vim

List cheatsheets

# list available cheatsheets
cheat -l

View cheatsheet

# view cheat
cheat <package name>
cheat docker

Own cheatsheets

Cheat allows to have our own/custom cheatsheets. Custom cheatsheets can be kept in your ~/.cheat directory.

# edit docker cheatsheet
# this command will open docker cheatsheet via vim
cheat -e <package name>
cheat -e docker

Its better to keep ~/.cheat directory in your ~/.dotfiles. I’m keeping it in my ~/.dotfiles directory and sync with GitHub.

--

--