cheat/INSTALLING.md

4.0 KiB

Installing

cheat has no runtime dependencies. As such, installing it is generally straightforward. There are a few methods available:

Install manually

Unix-like

On Unix-like systems, you may simply paste the following snippet into your terminal:

cd /tmp \
  && wget https://github.com/cheat/cheat/releases/download/4.4.0/cheat-linux-amd64.gz \
  && gunzip cheat-linux-amd64.gz \
  && chmod +x cheat-linux-amd64 \
  && sudo mv cheat-linux-amd64 /usr/local/bin/cheat

You may need to need to change the version number (4.4.0) and the archive (cheat-linux-amd64.gz) depending on your platform.

See the releases page for a list of supported platforms.

Windows

First, you must download the executable for Windows using this command:

Invoke-WebRequest -Uri https://github.com/cheat/cheat/releases/download/4.4.0/cheat-windows-amd64.exe.zip -OutFile cheat-windows-amd64.exe.zip

You may need to need to change the version number (4.4.0) if a newer version is released.

This will download the resource into the zipped folder cheat-windows-amd64.exe.zip.

Next, extract the contents of the newly created .zip file and navigate to the cheat-windows-amd64.exe application.

Next, rename the executable to "cheat.exe"

Now, run the application and type "y" to the prompts given to you. This will create the config file and download the community cheatsheets into this directory: C:\Users\[user]\AppData\Roaming\cheat

Next, move the executable cheat.exe to the directory mentioned above.

Now, go to Settings > System > About > Advanced System Settings > Environmental Variables In the bottom panel, look for the Path variable, then click Edit. Click New, then copy and paste the location of the "cheat" directory. By default, the location is C:\Users\[user]\AppData\Roaming\cheat

Note that you may change the location of the "cheat" directory. Just make sure that you also change the path in Environmental Variables.

Install via go install

If you have go version >=1.17 available on your PATH, you can install cheat via go install:

go install github.com/cheat/cheat/cmd/cheat@latest

Install via package manager

Several community-maintained packages are also available:

Package manager Package(s)
aur cheat, cheat-bin
brew cheat
docker docker-cheat
nix nixos.cheat
snap cheat

Configuring

Three things must be done before you can use cheat:

  1. A config file must be generated
  2. cheatpaths must be configured
  3. Community cheatsheets must be downloaded

On first run, cheat will run an installer that will do all of the above automatically. After the installer is complete, it is strongly advised that you view the configuration file that was generated, as you may want to change some of its default values (to enable colorization, change the paginator, etc).

conf.yml

cheat is configured by a YAML file that will be auto-generated on first run.

By default, the config file is assumed to exist on an XDG-compliant configuration path like ~/.config/cheat/conf.yml. If you would like to store it elsewhere, you may export a CHEAT_CONFIG_PATH environment variable that specifies its path:

export CHEAT_CONFIG_PATH="~/.dotfiles/cheat/conf.yml"