LinuxCommandLibrary

cheatshh

Display command usage examples and explanations

TLDR

Add a new command to the cheatshheet

$ cheatshh [[-a|--add]]
copy

Edit an existing command's description or group in the cheatshheet
$ cheatshh [[-ec|--edit-command]]
copy

Delete an existing command from the cheatshheet
$ cheatshh [[-dc|--delete-command]]
copy

Create a new group
$ cheatshh [[-g|--group]]
copy

Edit an existing group's name or description in the cheatsheet
$ cheatshh [[-eg|--edit-group]]
copy

Delete an existing group and it's sub commands from commands.json file
$ cheatshh [[-dg|--delete-group]]
copy

Display man pages after tldr in the preview
$ cheatshh [[-m|--man]]
copy

SYNOPSIS

cheatshh [OPTION...] [sheet[/subtopic]]

PARAMETERS

-h, --help
    Print usage information and exit

-l, --list
    List all available cheatsheets

-s, --search <TERM>
    Search cheatsheets by term

-p, --pretty
    Pretty-print output (JSON style)

-t, --tput
    Force color output using tput

-x
    Exclude examples and tests from output

sheet[/subtopic]
    Cheatsheet name or topic (e.g., 'tar/extract')

DESCRIPTION

cheatshh is a lightweight bash script providing quick access to the vast cheat.sh database of cheatsheets directly from the Linux terminal. It fetches concise, practical examples and syntax for thousands of commands, programming languages, tools, and concepts contributed by the community.

Unlike traditional man pages, cheatshh delivers focused, real-world usage examples formatted for readability. For instance, running cheatshh tar instantly shows common tar operations like extraction, creation, and listing archives. It supports subtopics (e.g., cheatshh python/async) for deeper dives.

Key features include searching the sheet database, pretty-printing JSON-like output, colorized display via tput, listing all available sheets, and even interactive editing or execution modes. It's ideal for developers, sysadmins, and learners needing rapid references without browsers or local installations.

The tool relies on curl to query cheat.sh servers, ensuring always-updated content. Installation is simple: curl https://cht.sh/:cht.sh > ~/.local/bin/cheatshh && chmod +x ~/.local/bin/cheatshh. Highly efficient, it pipes output to less or integrates with fzf for interactive selection.

CAVEATS

Requires internet connection and curl.
Server-dependent; content quality varies by contributions.
Not suitable for offline use without caching mods.

INSTALLATION

curl https://cht.sh/:cht.sh > ~/.local/bin/cheatshh
chmod +x ~/.local/bin/cheatshh
Add to PATH if needed.

EXAMPLES

cheatshh ls - ls command cheatsheet
cheatshh git - Git overview
cheatshh -l | grep docker - Find Docker sheets
cheatshh awk/oneline - Specific awk topic

INTEGRATION

Supports fzf for fuzzy search: chtf alias often used.
Configurable via $CHEATSHH_PAGER env var.

HISTORY

Part of the cheat.sh project launched in 2018 by Igor Yakushchenko. The cht.sh client script evolved as an official wrapper for easier CLI access, gaining popularity for its simplicity and integration with tools like fzf. Renamed variants like cheatshh appear in user customizations.

SEE ALSO

curl(1), tldr(1), man(1), less(1)

Copied to clipboard