Personal Cheat Sheet Programs
Every now and then, someone will post their favorite list of must-have CLI applications. I’m not gonna lie, these are like catnip for me. I love to read through these, because I usually learn about a couple of new commands. Sometimes, there is a replacement for a command I’m already using. The latest version of CLI tools post I read was published by Alicia Sykes, a London-based Software Engineer. What I enjoyed about this post was that it was thorough. There were several commands I don’t normally see in other lists – scc, entr, bandwhich, and khal – come to mind.
I’m definitely going to spend some time going through the list, and exploring the different commands, and their possibilities. Before I go down that rabbit hole, I wanted to discuss something that’s becoming more popular – cheat sheets. Every substantial cheat sheet program provides a set of common cheat sheets. They provide examples to demonstrate how to use common commands.
Available Cheat Sheet Programs
The command tldr
is a popular one. It’s a type of documentation, supplemental to the man pages. This style of program is called a cheat sheet command. It’s purpose is to show you some common use cases the command you want to know about. In reviewing the tldr
README file, they provide a list of similar commands.
Note: I’ve removed the descriptions for brevity. You can still read them on the tldr readme.
- Command Line Interface Pages
- Cheat
- cheat.sh
- devhints Rico’s cheatsheets
- eg
- kb
- navi
- bropages (deprecated)
If they all have the same purpose, then what sets them apart from one another? IMHO, The better programs also offer the ability to maintain personal cheat sheets. Another feature I look for in modern UNIX commands is XDG support. This provides greater control, so you manage things from your dotfiles repo. When you take these two features into account, this list of commands gets shorter.
Custom Cheat Sheets
When you can create custom cheat sheets, you now have a set of personal documentation at your figure tips. Sure you might have access to a wiki, Obsidian, Notion, Confluence, but they all serve the same purpose – in-depth documentation. Using personal cheat sheets can fill a gap. They help guide you to the documentation most relevant to you.
A personal cheat sheet isn’t limited to single commands. It’s just plain text. You might write a list of commands you use together for inspiration. Another idea is a note to describe a process. It depends upon what important to you to remember. Maybe you want to document aspects of your dotfiles without having to look through the code. Perhaps there’s some workflow recipes that help your productivity. A personal cheat sheet doesn’t have to be just a command with some options and arguments
The Importance of XDG Support
More and more commands have XDG support. This is great because, it gives you more control over your environment. How does it do that? Well the XDG Base Directory Specification defines a set of directories that applications should use to write their configuration and data. This prevents everyone from cluttering your home directory with their data and config files. Instead applications write their files into a sub-directory of XDG_CONFIG_HOME using its name. For example, Neovim uses ~/.config/nvim and the Ranger file manager uses ~/.config/ranger to store their config.
Why would you want this? Because, then you can move the XDG_CONFIG_HOME directory into your dotfiles. The more applications that use this standard, the less symlinks you need to point at your dotfiles directory. The result is a system that is more customizable and put you into control.
Wrap Up
After looking through the list above, I decided to use cheat. I like that they setup a separate directory for your personal cheat sheets. It’s super easy to use. With cheat, you can search through just your personal collection. This might be useful when you have a name that matches a well-known command. You know, for those times when you want to keep your best tricks for yourself. It lets you search by tag too. So if you know the topic, but not the exact command name, you can still find some inspiration. If you look for a cheat sheet, and you don’t find it, perhaps take the time to create one. There’s a community collection of cheat sheets that you can contribute to on Github. The way their personal cheat sheets are configured, you could also add another directory for team based cheat sheets, so that all of your team members have the same documentation.
In the future, I might switch to a different cheat sheet command. But for now, the cheat command seems to be a good fit. Which cheat sheet command did you choose? Let me know.