cht.sh(1)

πŸ“¦ version 0.0~git20220418.571377f, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– cht.sh β€” the manual, bestie edition πŸ’–

okay so you're looking at the manual page for cht.sh (that's cht.sh(1) if we're being formal, which we are not). It's the command line client for cheat.sh, and it is the only cheat sheet you need. no cap. 🫢


✨ NAME ✨

cht.sh β€” The only cheat sheet you need (command line client for cheat.sh) πŸ’…


🌸 SYNOPSIS 🌸

cht.sh [OPTIONS|QUERY]

πŸ¦‹ DESCRIPTION πŸ¦‹

So the cheat.sh service itself? iconic. it:

  • Covers 56 programming languages, several DBMSes, and more than 1000 most important UNIX/Linux commands. like, she's booked and busy. πŸ‘‘
  • Provides access to the best community driven cheat sheets repositories in the world, on par with StackOverflow. fr fr.

And 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:

  • 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. 🀫

πŸ’… OPTIONS πŸ’…

  • QUERY β€” process QUERY and exit. just one and done, main character energy.
  • --help β€” print help.
  • --shell [LANG] β€” shell mode (open LANG if specified). this is the one. the moment. ✨
  • --standalone-install [DIR|help] β€” install cheat.sh in the standalone mode (by default, into ~/.cheat.sh/).
  • --mode [auto|lite] β€” set (or display) mode of operation:
    • auto β€” prefer the local installation
    • lite β€” use the cheat sheet server

πŸŽ€ EXAMPLES πŸŽ€

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

🌈 AUTHOR 🌈

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).


and that's the whole thing bestie, love that for us πŸ’– this was cht.sh(1) from 23 September 2023 β€” go forth and query, you absolute legend πŸŒŸπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from