Install cheat and tldr

cheat

#!/bin/bash
set -e

version=4.2.0

cd /tmp

echo "Downloading cheat ${version}"
curl -sLO https://github.com/cheat/cheat/releases/download/${version}/cheat-darwin-amd64.gz
gunzip -f cheat-darwin-amd64.gz
mv cheat-darwin-amd64 /usr/local/bin
mkdir -p ~/.config/cheat

if [[ ! -f ~/.config/cheat/conf.yml ]]; then
    cheat --init > ~/.config/cheat/conf.yml
fi

cheat --help

printf "\nSee config file: ~/.config/cheat/conf.yml\n"

tldr

Assume node.js already installed.

$ npm install -g tldr
$ tldr --help
Usage: tldr command [options]

Simplified and community-driven man pages

Options:
  -V, --version            output the version number
  -l, --list               List all commands for the chosen platform in the cache
  -a, --list-all           List all commands in the cache
  -1, --single-column      List single command per line (use with options -l or -a)
  -r, --random             Show a random command
  -e, --random-example     Show a random example
  -f, --render [file]      Render a specific markdown [file]
  -m, --markdown           Output in markdown format
  -o, --os [type]          Override the operating system [linux, osx, sunos]
  --linux                  Override the operating system with Linux
  --osx                    Override the operating system with OSX
  --sunos                  Override the operating system with SunOS
  -t, --theme [theme]      Color theme (simple, base16, ocean)
  -s, --search [keywords]  Search pages using keywords
  -u, --update             Update the local cache
  -c, --clear-cache        Clear the local cache
  -h, --help               display help for command

  Examples:

    $ tldr tar
    $ tldr du --os=linux
    $ tldr --search "create symbolic link to file"
    $ tldr --list
    $ tldr --list-all
    $ tldr --random
    $ tldr --random-example

  To control the cache:

    $ tldr --update
    $ tldr --clear-cache

  To render a local file (for testing):

    $ tldr --render /path/to/file.md

Leave a Comment

Your email address will not be published.

19 − nine =