cheat.sh: The Cheat Sheet You Never Knew You Needed

You’re in the middle of a task, you need to remember how to do something with tar, curl, or git — and instead of opening a browser, Googling, wasting tokens with your AI agent, and losing your train of thought — you just type this:

curl cheat.sh/tar

Done. Straight to your terminal. No ads, no distractions.

That’s cheat.sh in a nutshell.

What Is cheat.sh?

cheat.sh is a community-driven cheat sheet service you query directly from your terminal (or browser). It aggregates content from StackOverflow, man pages, and official documentation — and serves it in a clean, readable format.

It covers:

  • Shell commands (tar, curl, ssh, rsync, …)
  • Programming languages (python, go, rust, bash, …)
  • Tools and frameworks (git, docker, kubectl, …)

It’s fast, free, and open source.

Getting Started

No installation needed. Just use curl:

curl cheat.sh/git

Or query something specific:

curl cheat.sh/git+stash

Want answers for a programming language?

curl cheat.sh/python/list+comprehension
curl cheat.sh/go/goroutines
curl cheat.sh/rust/option

It works great for infrastructure tools too:

curl cheat.sh/terraform

Or ask something more specific:

curl cheat.sh/terraform+import
curl cheat.sh/terraform+state+mv

For a nicer experience with syntax highlighting and shell integration, install the cht.sh client:

curl -s https://cht.sh/:cht.sh | sudo tee /usr/local/bin/cht.sh && sudo chmod +x /usr/local/bin/cht.sh

Then use it like this:

cht.sh tar extract
cht.sh docker run
cht.sh fish functions

You get colored output and it’s quicker to type.

Shell Integration (the Good Stuff)

The best part is the shell integration. Add this to your ~/.bashrc or ~/.config/fish/config.fish:

Bash / Zsh:

cht() {
  curl -s "cheat.sh/$1" | less -R
}

Fish:

function cht
  curl -s "cheat.sh/$argv" | less -R
end
funcsave cht

Now you just type:

cht ssh+port+forwarding
cht python+dict+merge

Tip: Use + instead of spaces in your queries.

A Real-World Workflow

Here’s how I use it day-to-day:

  1. Forget how rsync flags work → cht rsync
  2. Need a quick Python snippet → cht python/read+file
  3. Can’t remember ffmpeg syntax → cht ffmpeg+convert
  4. Git question mid-PR review → cht git+cherry-pick
  5. Terraform syntax while writing a module → cht terraform+import

It keeps me in the terminal and in flow. That’s the real win.

Is It Safe?

Yes — to read from. A few things worth knowing:

  • It’s open source on GitHub with ~40k stars
  • Uses HTTPS
  • Content is pulled from trusted sources (StackOverflow, man pages, official docs)

The one rule: never pipe its output directly to bash. Reading cheat sheets is safe. Blindly executing remote code is not — regardless of the source.

# Safe
curl cheat.sh/rm

# Don't do this
curl cheat.sh/rm | bash

Key Takeaways

  • Query cheat sheets directly from your terminal with curl cheat.sh/<topic>
  • Covers shell commands, programming languages, and popular tools
  • Install the cht.sh client for a better experience
  • Add a shell function for a fast, ergonomic workflow
  • Read from it freely — just don’t pipe to shell

cheat.sh is one of those tools that quietly makes you more productive every single day. Give it a week and you’ll wonder how you lived without it.

Finally, be sure to check out my buddy Mattias and his blog if your into Terraform or Cloud Engineering! He ain’t no cheater!

Happy hacking!