| cht.sh(1) | cht.sh(1) |
cht.sh - The only cheat sheet you need (command line client for cheat.sh)
cht.sh [OPTIONS|QUERY]
The cheat.sh service:
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:
Now, you can use cht.sh instead of curl, and write your queries in more natural way, with spaces instead of +:
$ cht.sh go reverse a list
$ cht.sh python random list elements
$ cht.sh js parse json
It is even more convenient to start the client in a special shell mode:
$ cht.sh --shell
cht.sh> 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:
$ cht.sh --shell
cht.sh> cd go
cht.sh/go> reverse a list
or even start the client in this context:
$ cht.sh --shell go
cht.sh/go> reverse a list
...
cht.sh/go> 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 /:
$ cht.sh --shell go
...
cht.sh/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).
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
Type help for other internal cht.sh commands.
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
The cht.sh was written by Igor Chubin <igor@chub.in>.
This manual page was written by Thiago Marques Siqueira <thiagoms.15@gmail.com> for the Debian project (but may be used by others).
| 23 September 2023 |