Scroll to navigation

CHEAT(1) General Commands Manual CHEAT(1)

NAME

cheat — create and view command-line cheatsheets

SYNOPSIS

cheat [options] [CHEATSHEET]

DESCRIPTION

cheat allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.

OPTIONS

–init
Print a config file to stdout.
Colorize output.
List cheatsheet directories.
Open CHEATSHEET for editing.
List available cheatsheets.
Filter only to sheets found on path PATH.
Treat search PHRASE as a regular expression.
Search cheatsheets for PHRASE.
Filter only to sheets tagged with TAG.
List all tags in use.
Print the version number.
–rm=CHEATSHEET
Remove (deletes) CHEATSHEET.

EXAMPLES

cheat foo
cheat -e foo
cheat -p work -e foo/bar
cheat -d
cheat -l
cheat -l apt
cheat -T
cheat -l -t personal
cheat -c -s ssh
cheat -c -r -s `(?:[0-9]{1,3}.){3}[0-9]{1,3}'
cheat –rm foo/bar

FILES

Configuration

cheat is configured via a YAML file that is conventionally named conf.yaml. cheat will search for conf.yaml in varying locations, depending upon your platform:

Linux, OSX, and other Unixes

1.
CHEAT_CONFIG_PATH
2.
XDG_CONFIG_HOME/cheat/conf.yaml
3.
$HOME/.config/cheat/conf.yml
4.
$HOME/.cheat/conf.yml

Windows

1.
CHEAT_CONFIG_PATH
2.
APPDATA/cheat/conf.yml
3.
PROGRAMDATA/cheat/conf.yml

cheat will search in the order specified above. The first conf.yaml encountered will be respected.

If cheat cannot locate a config file, it will ask if you’d like to generate one automatically. Alternatively, you may also generate a config file manually by running cheat –init and saving its output to the appropriate location for your platform.

Cheatpaths

cheat reads its cheatsheets from “cheatpaths”, which are the directories in which cheatsheets are stored. Cheatpaths may be configured in conf.yaml, and viewed via cheat -d.

For detailed instructions on how to configure cheatpaths, please refer to the comments in conf.yml.

Autocompletion

Autocompletion scripts for bash, zsh, and fish are available for download:

<https://github.com/cheat/cheat/blob/master/scripts/cheat.bash>
<https://github.com/cheat/cheat/blob/master/scripts/cheat.fish>
<https://github.com/cheat/cheat/blob/master/scripts/cheat.zsh>

The bash and zsh scripts provide optional integration with fzf, if the latter is available on your PATH.

The installation process will vary per system and shell configuration, and thus will not be discussed here.

ENVIRONMENT

The path at which the config file is available. If CHEAT_CONFIG_PATH is set, all other config paths will be ignored.
If set, autocompletion scripts will attempt to integrate with fzf.

RETURN VALUES

0.
Successful termination
1.
Application error
2.
Cheatsheet(s) not found

BUGS

See GitHub issues: <https://github.com/cheat/cheat/issues>

AUTHOR

Christopher Allen Lane <chris@chris-allen-lane.com>

SEE ALSO

fzf(1)