Command Line Tools for Designers #1: Homebrew
Managing applications and fonts using Homebrew, Homebrew Cask, and Caskroom Fonts.
I spend a lot of time working on front-end projects and there is no shortage of command line tools to increase productivity. Many of these tools would also benefit designers except most designers get limited exposure to the command line. This is part one in a series that aims to uncover command line tools that would benefit designers, and hopefully make them more productive in their day to day work.
I will focus primarily on macOS since that’s what I’m familiar with but many of the tools mentioned, or similar tools, are available for other operating systems.
Homebrew is a package manager for macOS that allows you to easily install UNIX and open source software packages.
Let’s get started, fire up your Terminal and install Homebrew by copy pasting the following command:
Please note: ‘$’ should be omitted from all commands. It’s there to let you know that this is entered into your command prompt.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
That was easy. This gives us a ‘brew’ command in our command line. This will form the base of all our Homebrew commands going forward. Now we need to make sure everything is set up correctly, we do this by running:
$ brew doctor
If everything is correct it should say “Your system is ready to brew.”
At this point you’re ready to start installing packages from Homebrew. However we’re going to ‘tap’ another repository that is going to give us access to familiar design applications, and that’s Homebrew Cask.
While Homebrew takes care of command line apps, Homebrew Cask takes care of the installation and management of GUI apps. These are the applications you’re used to installing with .dmg files. We install Homebrew Cask with the following Homebrew command:
$ brew tap caskroom/cask
This command ‘taps’ caskroom/cask which gives us access to all the packages (applications) within the Cask repository, and there are lots.
Why use Cask? Let’s say you want to download Sketch. Rather than going through the common process of:
Go to Sketch website → download the .dmg → install → move icon to apps folder
We can simply run:
$ brew cask install sketch
This will download the dmg file, install it, and place it in your Applications folder for you. Don’t wan’t Sketch any more? You can remove it by running:
$ brew cask uninstall sketch
You can search to see which applications are available via the command line or you can use the Cask website. Let’s say you want to search for Framer, the command is as follows:
$ brew cask search framer
The result is ‘framer is an exact match’. As you learned above you can install Framer with:
$ brew cask install framer
Homebrew Cask is only able to install and manage applications that are available outside of the App Store. If you need access to App Store only apps you can use mas.
Cask makes it easy install applications as you need them but it’s also great at getting a fresh machine up and running. Either for yourself or when onboarding new team members. I’ve created a few setup scripts that I run on a fresh machine that will download and install all my necessary tools. I’ll cover that in more detail at the end of this article.
While Cask is great for managing apps, you’re likely not doing that too often. Font management was an ongoing issue for me, luckily there is a Homebrew solution.
Caskroom Fonts lets you manage fonts from the command line through Homebrew Cask. You can install it by tapping the caskroom/fonts repository:
$ brew tap caskroom/fonts
You now have quick access to 1032 (at the time of writing) freely-distributable fonts. You can search, install, and uninstall them the same way you would any application through Homebrew Cask. One thing to note is all font packages are prefixed with ‘font-’
$ brew cask search font-roboto
$ brew cask install font-roboto
$ brew cask uninstall font-roboto
You can install multiple fonts/apps at the same time by structuring your command like this:
$ brew cask install font-roboto font-work-sans font-karla
To take it a step further you can create a shell script with all your Homebrew commands. You can then run this script on a fresh machine and everything will be installed for you. For clarity that script is intentionally verbose but can be written much short if/when you have a better understanding of shell scripts.
I’ve given a very surface level overview of Homebrew and Homebrew Cask. To learn more about all commands available you should run ‘brew’ or ‘brew cask’ like so.
$ brew cask
If you have any questions, comments, or suggestions dont’ hesitate to reach out to me @corygibbons on Twitter.