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.
–conf
Display the config file path.
Search among all cheatpaths.
List cheatsheets without file paths.
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.
Update git-backed cheatpaths by pulling the latest changes.
Print the version number.
–rm=CHEATSHEET
Remove (deletes) CHEATSHEET.
–completion=SHELL
Generate a shell completion script. SHELL must be one of: bash, zsh, fish, powershell.

EXAMPLES

cheat foo
cheat -e foo
cheat -p work -e foo/bar
cheat -d
cheat -l
cheat -b 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
cheat –update
cheat -u -p community
cheat –conf

FILES

Configuration

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

Linux, OSX, and other Unixes

1.
CHEAT_CONFIG_PATH
2.
XDG_CONFIG_HOME/cheat/conf.yml
3.
$HOME/.config/cheat/conf.yml
4.
$HOME/.cheat/conf.yml
5.
/etc/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.yml 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.yml, and viewed via cheat -d.

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

Autocompletion

cheat can generate shell completion scripts for bash, zsh, fish, and powershell via the –completion flag:

cheat --completion bash
cheat --completion zsh
cheat --completion fish
cheat --completion powershell
    

Completions are dynamically generated and include cheatsheet names, tags, and cheatpath names.

To install completions, pipe the output to the appropriate location for your shell. For example, on bash:

cheat --completion bash > /etc/bash_completion.d/cheat
    

Or for the current user only:

cheat --completion bash > ~/.local/share/bash-completion/completions/cheat
    

For zsh, you may need to add the completions directory to your fpath:

cheat --completion zsh > "${fpath[1]}/_cheat"
    

For fish:

cheat --completion fish > ~/.config/fish/completions/cheat.fish
    

ENVIRONMENT

The path at which the config file is available. If CHEAT_CONFIG_PATH is set, all other config paths will be ignored.

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)