cheat is a command line cheat manager,
where you can create and manage your personal cheatsheet
Pre-built packages for Windows, macOS, and Linux are found on the releases page.
Managed packages are in:
- Homebrew (MacOs)
brew tap darrikonn/formulae brew install darrikonn/formulae/cheat
- Scoop (Windows)
scoop bucket add app https://github.com/darrikonn/cheat.git scoop install cheat - Other (Linux distros)
curl -s https://raw.githubusercontent.com/darrikonn/cheat/master/install.sh | bash -s -- -b /usr/local/bin
Run cheat --help to see possible commands.
Here are some to get you started:
-
Run
cheatto list all your cheats. -
Run
cheat some.*regexto fetch cheats matching your regex. -
Run
cheat some.*regex addto add a new cheat.
Check out the api.
The location of your cheat data and your configuration will depend on these environment variables (in this order):
- CHEAT_HOME: determines where your
cheatsheet.dbandcheat.yamlfile will live - XDG_CONFIG_HOME: a fallback if
$CHEAT_HOMEis not set - HOME: a fallback if
$XDG_CONFIG_HOMEis not set. If$HOMEis used; all cheat files will be transformed to a dotfile, i.e.~/.cheatsheet.dband~/.cheat.yaml.
When adding/editing a cheat, you'll be prompted to edit the cheat's description in your preferred editor. You can set your desired editor in the $CHEAT_HOME/cheat.yaml config file:
editor: nvimIf no editor config is specified, the editor will fallback to your EDITOR environment variable. If that can't be found, the default selected editor will be vi.
A neat way to search your cheats, is by describing them with tags.
my summary
tags: [awesome, golang]
my descriptionThat way, you can simply search your cheats by tags, resulting in group like option for your cheats.
cheat 'tags: \[.*golang.*\]'