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

cheatsh [OPTIONS] [TOPIC[/SUBTOPIC][?QUERY][~QUERY]]

PARAMETERS

-h
    Display help message and exit.

-q
    Enable quiet mode, suppressing the welcome message.

-v
    Enable verbose mode, showing the URL being queried.

-i
    Enter interactive search and browsing mode.

-L
    List all available topics and commands.

-s SERVER_URL
    Specify a custom cheat.sh server URL. This allows using a local instance or a mirror.

-p
    Display a random cheat sheet page.

TOPIC
    The main command, language, or general topic to query (e.g., 'ls', 'python', 'git').

TOPIC/SUBTOPIC
    Query a specific sub-section or aspect within a topic (e.g., 'git/branch' or 'tar/extract').

TOPIC?QUERY
    Search for a specific keyword or phrase within the provided topic (e.g., 'grep?recursive').

TOPIC~QUERY
    Perform a fuzzy search for a query within the provided topic (e.g., 'tar~compress').

TOPIC/NUMBER
    Retrieve the Nth example for a given topic (e.g., 'tar/3' to get the third example for 'tar').

TOPIC:PAGER
    Pipe the output for a topic to a specified pager command (e.g., 'ls:less' to view 'ls' cheat sheet in less).

TOPIC:SHELL
    Request output formatted for a specific shell (e.g., 'python/:bash' for bash-specific python examples).

TOPIC@VERSION
    Retrieve examples specific to a certain version of a topic (e.g., 'python@3.9').

TOPIC#TAG
    Filter examples by a specific tag within a topic (e.g., 'docker#network').

DESCRIPTION

cheatsh (or cht.sh) is a powerful and highly versatile command-line utility designed to provide quick and comprehensive cheat sheets directly within your terminal. It serves as an invaluable resource for developers, system administrators, and anyone working frequently with the command line, offering immediate access to syntax, common usage patterns, and practical examples for thousands of Linux commands, programming languages, and various technical topics.

Instead of browsing traditional documentation or searching the web, cheatsh allows users to retrieve concise, relevant information by simply typing cheatsh <topic>. It fetches data from a remote server (by default, https://cheat.sh), which aggregates and curates information from various open-source projects and contributions. Its interactive mode, extensive search capabilities, and support for specific shell outputs make it an indispensable tool for boosting productivity and understanding complex commands on the fly. It's particularly useful for recalling infrequently used command options or quickly grasping new concepts.

CAVEATS

cheatsh primarily relies on internet connectivity to fetch cheat sheets from the cheat.sh server. While the server is generally considered reliable and secure, users should be mindful that they are retrieving content from a remote source.
The comprehensiveness and accuracy of the information depend on the content curated and contributed to the cheat.sh service.

DIRECT CURL ACCESS

The underlying cht.sh service can be accessed directly using curl, without installing the cheatsh client. For example, curl cht.sh/tar will display the cheat sheet for the tar command directly in your terminal. This is often used for quick, one-off lookups or in scripts.

CUSTOMIZATION AND ALIASING

Users often create shell aliases (e.g., alias cht='cheatsh') for quicker access. The default server URL can also be configured (via the -s option or an environment variable) to point to a local mirror or a different server.

HISTORY

cheatsh is a client-side wrapper for the highly popular cht.sh service, developed by Igor Chubin (chubin on GitHub). The cht.sh service itself emerged as a simple yet powerful way to get instant command-line help, popularized by its 'curlable' nature (i.e., `curl cht.sh/topic`).

The standalone cheatsh client was created to provide a more refined user experience, offering features like interactive mode, persistent settings, and better integration with the terminal environment, building upon the robust backend of the cht.sh web service. Its development has been community-driven, growing into an indispensable tool for terminal users globally.

SEE ALSO

man(1), tldr(1), info(1), apropos(1)

Copied to clipboard