These Are a Few of My Favorite CLI Things...

I've recently been perusing the setups at uses.tech. It's interesting to see where people have landed on hardware and software options, but I started thinking about some of the miscellaneous CLI utilities I've tried and picked up along the way. My work LIVES inside the terminal (as a Vim user) and here are some of the small things I've found to make it easier on myself (in no particular order):

tig #

Site: https://jonas.github.io/tig/

Git can be weird sometimes. While I don't use tig to perform any git operations, I find the explorer view helpful to see what's going on in there. Have you rebased correctly? What did your teammates just commit, and what files did it affect? I run this constantly on active projects to keep a mental picture of what's going on.

(So what DO I do most of my git actions with? I use Tim Pope's excellent Fugitive Vim plugin, but that's more Vim-based, so it doesn't qualify for this article...)

exa #

Site: https://the.exa.website/

exa is a more colorful way to list files and directories. It may seem simple, but when you're navigating around, having color-coded items, as well as other pertinent information right at hand, is a nice quality-of-life improvement. This has completely replaced ls -laF for me. I've aliased the two modes I use the most to:

alias ll='exa --long --header --git --all' # long form, everything
alias lt='exa --tree --level=2 --long --all' # tree view

bashmarks #

Github: https://github.com/huyng/bashmarks

I found this bash script about 12 years ago and I've used it every day since then. It's a very simple bookmarking system for navigating directories with tab completion and very short commands. s saves the current directory with the name you give it, and g + name takes you right back to that path.

I've tried fuzzy completion and other fancier bookmarking options, but this one is so simple and does just what I need that I've wound up back at bashmarks several times. I'll save the fancy fuzzy searching for INSIDE projects, I'd rather just teleport to where I need to go. I highly recommend this script if you need a simple navigation option.

ffmpeg #

Site: https://ffmpeg.org/

This is an absolute monster of a video and audio tool. Need to compress a looping ambient hero video? Run it through ffmpeg. Need to strip the audio from something? Run it through ffmpeg. Need to quickly trim down a video? You guessed it, ffmpeg. I have shaved innumerable megabytes of video data with this tool while processing assets for client projects.

The only beef I have with it is that writing out the arguments for proper compression is like trying to write an arcane spell. You need special knowledge of ffmpeg's vast options and some knowledge of video codecs to make your way. Yet despite that, it remains an indispensable tool for front-end development.

The video screencaps in this article were captured with a normal Quicktime screen recording, but I have a special quickfire mov-to-mp4 command that uses the absolute basic mp4 defaults and still manages to make them 5-10% of the original .mov size:

# Quicktime mov files are so big!
function movtomp4() {
	for i in *.mov; do 
		ffmpeg -i "$i" "${i}.mp4"; 
	done
}

At some point, I'll have to write up my cheatsheet for ffmpeg...

degit #

Github: https://github.com/Rich-Harris/degit

I learned about degit from the Vite docs, and it's become my go-to way for initializing a prototype kit. When I have an idea I want to try, I turn to degit and let it grab all the configuration files for me. Need Tailwind? Grab a starter kit for that. Testing out something in React? There's a starter kit you can pull for that too.

In fact, I made a few starter kits of my own.

just #

Github: https://github.com/casey/just

Do you have a project that needs lots of arbitrary commands? Things you have to continually look up and paste back into your console? just helps provide a unified layer on top of whatever system you're using. Unlike a Rakefile or Makefile, it's not bound to any specific language, you can just feed it whatever commands you'd like and it'll run them for you.

It even pairs nicely with the previous utility, degit to help form a rapid-start prototyping area with project templates

asdf #

Site: https://asdf-vm.com/

It can be tough to make sure that your environments are in sync across projects, versions, and even programming languages. For a while, I was using language-specific version managers (nvm, rvm, with all the shims that come with it) but Viget introduced me to asdf as an all-in-one way to manage all these different languages in a way that didn't have me pulling my hair out.

btop #

Github: https://github.com/aristocratos/btop

Think Activity Monitor, but way cooler looking and accessible without clicking a bunch of things. btop is a pleasing way to see just what is making your computer slow down to a crawl (shakes fist at Docker).

Newsletter

Want to receive these thoughts and others in your inbox?

Discussion

Want to discuss this? Email Me