the only cheat sheet you need

Unified access to the best community driven cheat sheets repositories of the world.

Let's imagine for a moment that there is such a thing as an ideal cheat sheet. What should it look like? What features should it have?

  • Concise — It should only contain the things you need, and nothing else.
  • Fast — It should be possible to use it instantly.
  • Comprehensive — It should contain answers for every possible question.
  • Universal — It should be available everywhere, anytime, without any preparations.
  • Unobtrusive — It should not distract you from your main task.
  • Tutoring — It should help you to learn the subject.
  • Inconspicuous — It should be possible to use it completely unnoticed.

Such a thing exists.


  • Has a simple curl/browser interface.
  • Covers 56 programming languages, several DBMSes, and more than 1000 most important UNIX/Linux commands.
  • Provides access to the best community driven cheat sheets repositories in the world, on par with StackOverflow.
  • Available everywhere, no installation needed.
  • Ultrafast, returns answers within 100 ms, as a rule.
  • Has a convenient command line client,, that is very advantageous and helpful, though not mandatory.
  • Can be used directly from code editors, without opening a browser and not switching your mental context.
  • Supports a special stealth mode where it can be used fully invisibly without ever touching a key and and making sounds.


To get a cheat sheet for a UNIX/Linux command from a command line, query the service using curl or any other HTTP/HTTPS client specifying the name of the command in the query:


As you can see, you can use both HTTPS and HTTP to access the service, and both the long ( and the short ( service names.

Here tar, curl, rsync, and tr are names of the UNIX/Linux commands you want to get cheat sheets for.

If you don't know the name of the command you need, you can search for it using the ~KEYWORD notation. For example, to see how you can make snapshots of a filesystem/volume/something else:


The programming language cheat sheets are located in special namespaces dedicated to them.


To get the list of available programming language cheat sheets, use the special query :list:


Almost each programming language has a special page named :learn that describes the language basics (that's a direct mapping from the "Learn X in Y" project). It could be a good starting point if you've just started learning a language.

If there is no cheat sheet for a programming language query (and it is almost always the case), it is generated on the fly, based on available cheat sheets and answers on StackOverflow. Of course, there is no guarantee that the returned cheat sheet will be a 100% hit, but it is almost always exactly what you are looking for.

Try these (and your own) queries to get the impression of that, what the answers look like:


If you don't like an answer for your queries, you can pick another one. For that, repeat the query with an additional parameter /1, /2 etc. appended:


Cheat sheets are formatted as code of the queried programming language (at least we are trying our best to do so) so they can be pasted into a program in this language directly. Text comments, if there are any, are formatted according to the language syntax.

$ curl     -- lua: retrieve list of keys in a table     local keyset={}     local n=0     for k,v in pairs(tab) do      n=n+1      keyset[n]=k     end     --[[       [ Note that you cannot guarantee any order in keyset. If you want the       [ keys in sorted order, then sort keyset with table.sort(keyset).       [        [ [lhf] [so/q/12674345] [cc by-sa 3.0]       ]]

If you don't need text comments in the answer, you can eliminate them using a special option ?Q:

$ curl     local keyset={}     local n=0     for k,v in pairs(tab) do      n=n+1      keyset[n]=k     end

And if you don't need syntax highlighting, switch it off using ?T. You can combine the options together:


Full list of all options described below and in /:help.

Try your own queries. Follow these rules:

  1. Try to be more specific (/python/append+file is better than /python/file and /python/append).
  2. Ask practical question if possible (yet theoretical question are possible too).
  3. Ask programming language questions only; specify the name of the programming language as the section name.
  4. Separate words with + instead of spaces.
  5. Do not use special characters, they are ignored anyway.
  6. If you want to eliminate cheat sheets containing some word, add it to the query with +-: python/multiply+matrices+-numpy

Read more about the programming languages queries below.

Command line client,

The service has its own command line client ( that has several useful features compared to querying the service directly with curl:

  • Special shell mode with a persistent queries context and readline support.
  • Queries history.
  • Clipboard integration.
  • Tab completion support for shells (bash, fish, zsh).
  • Stealth mode.


To install the client:

    mkdir -p ~/bin/
    curl > ~/bin/
    chmod +x ~/bin/

or to install it globally (for all users):

    curl | sudo tee /usr/local/bin/
    chmod +x /usr/local/bin/

Note: The package "rlwrap" is a required dependency to run in shell mode. Install this using sudo apt install rlwrap

Client usage

Now, you can use instead of curl, and write your queries in more natural way, with spaces instead of +:

    $ go reverse a list
    $ python random list elements
    $ js parse json

It is even more convenient to start the client in a special shell mode:

    $ --shell> go reverse a list

If all your queries are about the same language, you can change the context and spare repeating the programming language name:

    $ --shell> cd go> reverse a list

or even start the client in this context:

    $ --shell go> reverse a list
    ...> join a list

If you want to change the context, you can do it with the cd command, or if you want do a single query for some other language, just prepend it with /:

    $ --shell go
    ...> /python dictionary comprehension

If you want to copy the last answer into the clipboard, you can use the c (copy) command, or C (ccopy, without comments).> append file
    #  python - How do you append to a file?

    with open("test.txt", "a") as myfile:
        myfile.write("appended text")> C
    copy: 2 lines copied to the selection

Type help for other internal commands.> help
	help    - show this help
	hush    - do not show the 'help' string at start anymore
	cd LANG - change the language context
	copy    - copy the last answer in the clipboard (aliases: yank, y, c)
	ccopy   - copy the last answer w/o comments (cut comments; aliases: cc, Y, C)
	exit    - exit the cheat shell (aliases: quit, ^D)
	id [ID] - set/show an unique session id ("reset" to reset, "remove" to remove)
	stealth - stealth mode (automatic queries for selected text)
	update  - self update (only if the scriptfile is writeable)
	version - show current version
	/:help  - service help
	QUERY   - space separated query staring (examples are below)> python zip list> zip list> /python zip list

The client has its configuration file which is located at ~/ (location of the file can be overriden by the environment variable CHTSH_CONF). Use it to specify query options that you would use with each query. For example, to switch syntax highlighting off create the file with the following content:


Or if you want to use a special syntax highlighting theme:


(curl to see all supported styles).

Other configuration parameters:

CHTSH_CURL_OPTIONS="-A curl"        # curl options used for queries
CHTSH_URL=            # URL of the server

Tab completion

Bash Tab completion

To activate tab completion support for, add the :bash_completion script to your ~/.bashrc:

    $ curl > ~/.bash.d/
    $ . ~/.bash.d/
    $ # and add . ~/.bash.d/ to ~/.bashrc

ZSH Tab completion

To activate tab completion support for, add the :zsh script to the fpath in your ~/.zshrc:

    $ curl > ~/.zsh.d/_cht
    $ echo 'fpath=(~/.zsh.d/ $fpath)' >> ~/.zshrc
    $ # Open a new shell to load the plugin

Stealth mode

Being used fully unnoticed is one of the most important property of any cheat sheet. can be used completely unnoticed too. The client,, has a special mode, called stealth mode. Using that, you don't even need to touch your keyboard to open a cheat sheet.

In this mode, as soon as you select some text with the mouse (and thus adding it into the selection buffer of X Window System or into the clipboard) it's used as a query string for, and the correspondent cheat sheet is automatically shown.

Let's imagine, that you are having an online interview, where your interviewer asks you some questions using a shared document (say Google Docs) and you are supposed to write your coding answers there (it's possible too that you'll type in the questions on your own, just to show to the interviewer that you've heard it right).

When using the stealth mode of, the only thing you need to do in order to see a cheat sheet for some question, is to select the question using the mouse. If you don't want any text in the answers and the only thing you need is code, use the Q option when starting the stealth mode.

Windows command line client

You can access from Windows command line too.

Use command line client for that: cht.exe. It supports:

  • output colorization;
  • command line options;
  • its own configuration file.

You can also use scoop command-line installer for Windows to get it:

scoop install cht



Currently, the easiest way to get a self-hosted instance running is by using the docker-compose.yml file provided in the extra/docker folder. This pulls down the latest image with baked in cheatsheets and starts the app and a Redis instance to back it, making the service available on port 8002 of the local host. This is currently an early implementation and should probably not be used for anything outside of internal/dev/personal use right now.

Editors integration

You can use directly from the editor (Emacs, Sublime, Vim, and Visual Studio Code are currently supported; not all features are supported by all plugins though; see below). Instead of opening your browser, googling, browsing Stack Overflow and eventually copying the code snippets you need into the clipboard and later pasting them into the editor, you can achieve the same instantly and without leaving the editor at all!

Here is what it looks like in Vim:

  1. If you have a question while editing a program, you can just type your question directly in the buffer and press <leader>KK. You will get the answer to your question in pager. (with <leader>KB you'll get the answer in a separate buffer).
  2. If you like the answer, you can manually paste it from the buffer or the pager, or if you are lazy you can use <leader>KP to paste it below/under your question (or replace you question using <leader>KR). If you want the answer without the comments, <leader>KC replays the last query toggling them.

If you use some static analysis plugin such as syntastic (for Vim), you can use its warning and error messages as queries: place the cursor on the problem line and press <leader>KE: explanation for the warning will be opened in a new buffer.

Features supported by plugins for different editors:

FeatureEmacsSublimeVimVSCodeIDEACommand queries✓✓✓✓✓Queries from buffer✓✓Toggle comments✓✓✓Prev/next answer✓✓✓Multiple answers✓✓Warnings as queries✓Queries history✓✓Session id✓Configurable server✓✓✓


Here is Vim configuration example:

" some configuration above ... let mapleader=" " call vundle#begin() Bundle 'gmarik/vundle'Bundle 'scrooloose/syntastic'Bundle 'dbeniamine/'call vundle#end()  let g:syntastic_javascript_checkers = [ 'jshint' ] let g:syntastic_ocaml_checkers = ['merlin'] let g:syntastic_python_checkers = ['pylint'] let g:syntastic_shell_checkers = ['shellcheck']  " some configuration below ...

In this example, several Vim plugins are used:

Syntastic shows warnings and errors (found by code analysis tools: jshint, merlin, pylint, shellcheckt etc.), and` shows you explanations for the errors and warnings and answers on programming languages queries written in the editor.

Watch a demo, where the most important features of the Vim plugin are shown (5 Min):

Visual Studio Code


  1. Hit ⌘ Command + ⇧ Shift + p
  2. Run Snippet: Find.
  3. Type your query and hit enter.



  1. Write your query string.
  2. Select the query string.
  3. Press Cmd + ⇧ Shift + B to replace the selected query string by the answer generated from

Special pages

There are several special pages that are not cheat sheets. Their names start with colon and have special meaning.

Getting started:

    :help               description of all special pages and options
    :intro     introduction, covering the most important usage questions
    :list               list all cheat sheets (can be used in a subsection too: /go/:list)

Command line client and shells support:             code of the client
    :bash_completion    bash function for tab completion
    :bash               bash function and tab completion setup
    :fish               fish function and tab completion setup
    :zsh                zsh function and tab completion setup

Editors support:

    :vim       support for Vim
    :emacs     function for Emacs
    :emacs-ivy function for Emacs (uses ivy)

Other pages:

    :post               how to post new cheat sheet
    :styles             list of color styles
    :styles-demo        show color styles usage examples

To search for a keyword, use the query:


In this case search is not recursive — it is conducted only in a page of the specified level. For example:

    /~snapshot          look for snapshot in the first level cheat sheets
    /scala/~currying     look for currying in scala cheat sheets

For a recursive search in all cheat sheets, use double slash:

    /~snapshot/r         look for snapshot in all cheat sheets

You can use special search options after the closing slash:

    /~shot/bi           case insensitive (i), word boundaries (b)

List of search options:

    i   case insensitive search
    b   word boundaries
    r   recursive search

Programming languages cheat sheets

Cheat sheets related to programming languages are organized in namespaces (subdirectories), that are named according to the programming language.

For each supported programming language there are several special cheat sheets: its own sheet, hello, :list and :learn. Say for lua it will look like:


Some languages has the one-liners-cheat sheet, 1line:

  • hello describes how you can start with the language — install it if needed, build and run its programs, and it shows the "Hello world" program written in the language;
  • :list shows all topics related to the language
  • :learn shows a learn-x-in-minutes language cheat sheet perfect for getting started with the language.
  • 1line is a collection of one-liners in this language
  • weirdness is a collection of examples of weird things in this language usage

At the moment, covers the 58 following programming languages (alphabetically sorted):

PrefixLanguageBasicsOne-linersWeirdnessStackOverflowarduino/Arduino✓assembly/Assembly✓awk/AWK✓✓bash/Bash✓✓basic/BASIC✓bf/Brainfuck✓✓c/C✓✓chapel/Chapel✓✓clean/Clean✓clojure/Clojure✓✓coffee/CoffeeScript✓✓cpp/C++✓✓csharp/C#✓✓d/D✓✓dart/Dart✓✓delphi/Dephi✓dylan/Dylan✓✓eiffel/Eiffel✓elixir/Elixir✓✓elisp/ELisp✓✓elm/Elm✓✓erlang/Erlang✓✓factor/Factor✓✓fortran/Fortran✓✓forth/Forth✓✓fsharp/F#✓✓go/Go✓✓groovy/Groovy✓✓haskell/Haskell✓✓java/Java✓✓js/JavaScript✓✓✓✓julia/Julia✓✓kotlin/Kotlin✓✓latex/LaTeX✓✓lisp/Lisp✓✓lua/Lua✓✓matlab/MATLAB✓✓nim/Nim✓✓ocaml/OCaml✓✓octave/Octave✓✓perl/Perl✓✓✓perl6/Perl 6✓✓✓php/PHP✓✓pike/Pike✓python/Python✓✓✓python3/Python 3✓✓r/R✓✓racket/Racket✓✓ruby/Ruby✓✓rust/Rust✓✓scala/Scala✓✓scheme/Scheme✓✓solidity/Solidity✓✓swift/Swift✓✓tcsh/Tcsh✓✓tcl/Tcl✓✓objective-c/Objective-C✓✓vb/VisualBasic✓✓vbnet/VB.Net✓✓

And several other topics, that are though related to programming, are not programming languages:


Cheat sheets sources

Instead of creating yet another mediocre cheat sheet repository, we are concentrating our efforts on creation of a unified mechanism to access selected existing well developed and good maintained cheat sheet repositories covering topics of our interest: programming and operating systems usage. uses selected community driven cheat sheet repositories and information sources, maintained by thousands of users, developers and authors all over the world (in the Users column number of contributors/number of stars is shown):