CHEAT(1)

πŸ“¦
version 4.4.2 Β· 3 versions
, in opensuse-leap 16.0

okay so bestie, this is CHEAT(1) from the General Commands Manual β€” your command-line cheatsheet era starts now πŸ’…βœ¨

🌸 NAME 🌸

cheat β€” create and view command-line cheatsheets

✨ SYNOPSIS ✨

cheat [options] [CHEATSHEET]

πŸ’– DESCRIPTION πŸ’–

okay so cheat lets you create and view interactive cheatsheets right on the command-line. It was literally designed to help remind *nix system administrators about options for commands they use frequently, but not frequently enough to actually remember β€” we’ve all been there 😭.

πŸ’… OPTIONS πŸ’…

  • –init β€” prints a config file to stdout.
  • -c, –colorize β€” colorizes the output. make it cute ✨
  • -d, –directories β€” lists cheatsheet directories.
  • -e, –edit=CHEATSHEET β€” opens CHEATSHEET for editing.
  • -l, –list β€” lists available cheatsheets.
  • -p, –path=PATH β€” filters so you only see sheets found on PATH.
  • -r, –regex β€” treats search PHRASE as a regular expression.
  • -s, –search=PHRASE β€” searches cheatsheets for PHRASE.
  • -t, –tag=TAG β€” filters so you only see sheets tagged with TAG.
  • -T, –tags β€” lists all tags in use.
  • -v, –version β€” prints the version number.
  • –rm=CHEATSHEET β€” removes (deletes) CHEATSHEET. gone, periodt πŸ’€

πŸŽ€ EXAMPLES πŸŽ€

  • To view the foo cheatsheet:
cheat foo
  • To edit (or create) the foo cheatsheet:
cheat -e foo
  • To edit (or create) the foo/bar cheatsheet on the work cheatpath:
cheat -p work -e foo/bar
  • To view all cheatsheet directories:
cheat -d
  • To list all available cheatsheets:
cheat -l
  • To list all cheatsheets whose titles match apt:
cheat -l apt
  • To list all tags in use:
cheat -T
  • To list available cheatsheets that are tagged as personal:
cheat -l -t personal
  • To search for ssh among all cheatsheets, and colorize matches:
cheat -c -s ssh
  • To search (by regex) for cheatsheets that contain an IP address:
cheat -c -r -s `(?:[0-9]{1,3}.){3}[0-9]{1,3}'
  • To remove (delete) the foo/bar cheatsheet:
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 πŸ’–

bestie, the search order is sacred β€” first one wins, no cap.

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:

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 🌈

  • CHEAT_CONFIG_PATH β€” the path at which the config file is available. If CHEAT_CONFIG_PATH is set, all other config paths will be ignored.
  • CHEAT_USE_FZF β€” 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)


and that’s the footer tea, bestie β˜•: CHEAT(1) from the General Commands Manual β€” no separate version number or date was chilling in the original footer, so this is the sparkly sign-off πŸ«ΆπŸ’–

πŸ“¦ where this page comes from