evergreen

Aesthetic Command Lines with Hyper, Spaceship, and Oh My Zsh

My fairly banal, basic, but beautiful command line setup

After a recent accident with a pressurised water bottle on an airplane, I had to hard reset my Macbook. Or rather, the kind folks at the Apple Support desk reset it for me, after replacing the water-logged screen and logic board. I wish I could tell you this was the first time it’s ever happened to me, but it’s not. AppleCare+ has paid for itself many times over.

Not a big deal, but it meant I had to go through setting up my local development environment from scratch. I’ve done this enough times that I have a checklist of things I usually run through. Most of these are boring; git, github, homebrew, node, yarn, python, etc.

The fun part is making the command line itself beautiful. I spend enough time in it that it matters whether it looks and feels right to me. I’ve settled on a combination of the Hyper terminal, the Spaceship prompt, and Oh My Zsh for small conveniences. Here’s what it looks like:

My command line styled with hyper and spaceship

Compared to most developers, this is a pretty minimal set of customisations, but it’s enough for me; it’s clean, minimal, and readable. I primarily use Hyper to handle the styling and colours. When you install Hyper, it’ll automatically create a .hyper.js config file for you in your root directory. This is where you can tweak fonts, spacing, themes, and add plugins. You can open it in your standard code editor (VS Code, or whatever) by typing code ~/.hyper.js in the command line. Here’s my full hyper.js config file if you want to see what I’ve customised.

The theme I use is hyper-material-theme and the typeface is JetBrains Mono , both of which are free. You can browse plenty of other themes and plugins on the Awesome Hyper repository.

I also use the Hyper plugin hyper-statusline which adds a small bar to the bottom of the window with quicklinks to the working directory, the git commit hash, and number of dirty (uncommited) files. Clicking the former opens the directory in Finder, and the latter opens the commit on Github.

Oh My Zsh doesn’t add much to the aesthetics here, but has useful plugins and makes installing Spaceship easy (described below). But I particularly like the zsh-autosuggestions plugin which autosuggests commands and files based on your previous behaviour.

Zsh autocomplete in the command line

Spaceship is what makes the prompt beautiful and shows me useful information like my current working directory, git branch, whether I have unstaged changes, and process run times. I just use their default prompt, but they offer an exessive number of configuration options.

Assuming you’re using either Zsh or Oh My Zsh, you can set it via your /.zshrc file. You first need to clone the Github repo and symlink it, then set ZSH_THEME="spaceship" in the zshrc config file; instructions are on the Github repo .

That’s it. Nothing crazy complicated. Just a slightly nicer feeling command line experience.

Mentions around the web

Accidental theme: terminal colors. What happens to “.io” TLD after UK gives back the Chagos Islands? (via) Aesthetic Command Lines. Terminal colours are tricky. (via) TerminalTinder. (via) Wulfwald Bundle of Holding. OD&D compatible and Anglo-Saxon themed. awktober, and 30 day