.\" Text automatically generated by txt2man .TH cht.sh 1 "23 September 2023" "" "" .SH NAME \fBcht.sh \fP- The only cheat sheet you need (command line client for cheat.sh) .SH SYNOPSIS .nf .fam C cht.sh [OPTIONS|QUERY] .fam T .fi .fam T .fi .SH DESCRIPTION The cheat.sh service: .RS .IP \(bu 3 Covers 56 programming languages, several DBMSes, and more than 1000 most important UNIX/Linux commands. .IP \(bu 3 Provides access to the best community driven cheat sheets repositories in the world, on par with StackOverflow. .RE .PP The cheat.sh service has its own command line client (cht.sh) that has several useful features compared to querying the service directly with curl: .RS .IP \(bu 3 Special shell mode with a persistent queries context and readline support. .IP \(bu 3 Queries history. .IP \(bu 3 Clipboard integration. .IP \(bu 3 Tab completion support for shells (bash, fish, zsh). .IP \(bu 3 Stealth mode. .SH OPTIONS .TP .B QUERY process QUERY and exit. .TP .B \fB--help\fP print help. .TP .B \fB--shell\fP [LANG] shell mode (open LANG if specified). .TP .B \fB--standalone-install\fP [DIR|help] install cheat.sh in the standalone mode (by default, into ~/.cheat.sh/). .TP .B \fB--mode\fP [auto|lite] set (or display) mode of operation: .RS .IP \(bu 3 auto - prefer the local installation .IP \(bu 3 lite - use the cheat sheet server .SH EXAMPLES Now, you can use cht.sh instead of curl, and write your queries in more natural way, with spaces instead of +: .PP .nf .fam C $ cht.sh go reverse a list $ cht.sh python random list elements $ cht.sh js parse json .fam T .fi It is even more convenient to start the client in a special shell mode: .PP .nf .fam C $ cht.sh --shell cht.sh> go reverse a list .fam T .fi If all your queries are about the same language, you can change the context and spare repeating the programming language name: .PP .nf .fam C $ cht.sh --shell cht.sh> cd go cht.sh/go> reverse a list .fam T .fi or even start the client in this context: .PP .nf .fam C $ cht.sh --shell go cht.sh/go> reverse a list \.\.\. cht.sh/go> join a list \.\.\. .fam T .fi 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 /: .PP .nf .fam C $ cht.sh --shell go \.\.\. cht.sh/go> /python dictionary comprehension \.\.\. .fam T .fi If you want to copy the last answer into the clipboard, you can use the c (copy) command, or C (ccopy, without comments). .PP .nf .fam C cht.sh/python> append file # python - How do you append to a file? with open("test.txt", "a") as myfile: myfile.write("appended text") cht.sh/python> C copy: 2 lines copied to the selection .fam T .fi Type help for other internal cht.sh commands. .PP .nf .fam C cht.sh> 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 cht.sh version /:help - service help QUERY - space separated query staring (examples are below) cht.sh> python zip list cht.sh/python> zip list cht.sh/go> /python zip list .fam T .fi .SH AUTHOR The cht.sh was written by Igor Chubin . .PP This manual page was written by Thiago Marques Siqueira for the Debian project (but may be used by others).