https://a.storyblok.com/f/270183/151163/800fe1ab72/customize-macos-starship.png

Customize Your macOS Terminal Using Starship

Published on April 11, 2024

Time to read: 13 minutes

It's a Whole Vibe

As someone easily drawn to pretty and aesthetic things, customizing my macOS terminal to create an environment I resonate with has helped improve my productivity and simplify complex tasks. In this blog post, I'll show you how to create your own vibe by using Starship.

Are you ready to customize your terminal? Let's go!

What Is Starship?

Starship is an open-source, customizable prompt for shell environments used in command-line interfaces (CLI). It allows users to easily modify its appearance and the type of information it shows, such as Git status or programming language versions, by editing a simple configuration file. It's designed to be quick and light, so your work won't be slowed down in the terminal. A key advantage of Starship is that it works with various shells like Bash, Zsh, and Fish, keeping the terminal experience consistent and efficient. This means you can use it in different environments without needing to adjust to a new setup each time.

While Starship is available on Android, BSD, Linux, macOS, and Windows, for this blog, we'll be focusing on setup instructions for macOS.

Just to clarify: A "terminal" with a lowercase "t" refers to a general terminal emulator, or terminal application, which is a computer program that emulates a video terminal within another display architecture. "Terminal" with a capital "T" refers to the terminal emulator included in the macOS operating system by Apple.

This gif shows a customized terminal with colorful words in a unique font being typed.Demo of Customized Terminal

How to Set Up Starship

1. Install Starship

Open up a new Terminal window and run the following command:

curl -sS https://starship.rs/install.sh | sh

Alternatively, if you have brew installed, you can do this instead:

brew install starship

2. Set up your shell

Now choose and configure your shell. Starship supports a list of different shells, but for this blog post, we'll be using Zsh.

To edit your Zsh configuration file, run:

nano ~/.zshrc

This will open your .zshrc configuration file in a nano text editor. Once the file is open in nano, add the following to the end of it:

eval "$(starship init zsh)"

Save your file with the nano command Ctrl+O and when promoted, hit Return . With your file now saved, use Ctrl+X to exit the editor. Your changes will be applied to the configuration immediately.

Check out the nano website for a cheat sheet of nano's shortcuts.

3. Choosing and installing a font

You can choose whatever font you'd like from the Nerd Fonts website. For this blog post, I decided to download FiraCode Nerd Font because it is readable and compatible with a wide range of development tools and environments.

This image displays a window from the macOS font book titled 3 typefaces showing FiraCode Nerd Font as a dropdown option.Font BookOnce you've chosen and downloaded your font, extract its contents from the zip file. Open that new folder to view the font files inside.

Select all the font files (they will have a .ttf or .otf extension) that you want to install. Right-click on the selected font files and choose Open or Open with and select Font Book (macOS's default font manager) to open them.

Font Book will open and display the selected font files like this:

This image displays a window from the macOS font book titled 3 typefaces showing FiraCode Nerd Font as a dropdown option.Font BookClick Install for each font variant you want available to use (regular, bold, italic, etc.). Alternatively, you can drag and drop the font files into the Font Book window to install them. Once that is done, you should see your new font in your Font Book under My Fonts.

This image shows the window titled Profiles from Terminal with the Text tab opened, showing that FiraCode Nerd Font is set as the font.Terminal ProfilesOnce the fonts are installed, you can verify their installation by checking to see if you can use them in your Terminal profiles. To do so, open Terminal. At the top left of your screen, click on Terminal and then Settings. With the Settings window open, select the Profiles menu. If you see the FiraCode Nerd Font options in the font selection drop down menu, then the fonts have been successfully installed.

Select your fonts in your Pofile and your terminal window will be updated accordingly.

This image shows the window titled Profiles from Terminal with the Text tab opened, showing that FiraCode Nerd Font is set as the font.Terminal Profiles

4. Create and edit the Starship configuration file

Type the following command in your terminal to create and edit the starship.toml file:

nano ~/.config/starship.toml

With this file, you can customize Starship to your liking.

Customizing Starship

This is where you get to change the terminal. You can change every aspect of your prompt with the starship.toml file.

Configuring Starship

I was inspired by therubberduckiee's terminal, so I used her dev environment file as a template. Copy and paste the contents of this file into your starship.toml file, and change the HEX codes to whatever you want. I replaced her colors with the HEX codes for the Vonage brand colors:

Color HEX Code
Purple 871FFF
Magenta D62190
Cyan 80C7F5
Peach FFA68C
Orange FA7554

The image displays a color chart with six colors, each accompanied by their respective RGB, HEX, CMYK, and PMS codes. The colors and their codes are:  Purple: RGB (135, 31, 255), HEX #871FFF, CMYK (79, 87, 0, 0), PMS 2090C Magenta: RGB (214, 33, 156), HEX #D6219C, CMYK (16, 100, 0, 0), PMS 2405C Cyan: RGB (128, 199, 245), HEX #80C7F5, CMYK (50, 0, 0, 0), PMS 2141C Peach: RGB (255, 166, 140), HEX #FFA68C, CMYK (0, 42, 32, 0), PMS 487C Orange: RGB (250, 117, 84), HEX #FA7554, CMYK (0, 68, 68, 0), PMS 2024C The chart is organized in blocks of color with the information below each color, set on a white background for clear readability.Vonage ColorsIf you need to find the HEX codes for the colors you want to use, a tool like Color Hex can help you out!

Once you've updated the Starship configuration file to your liking, save your changes, and your terminal should be good to go!

Try Out Your New Terminal

Now let's see those beautiful changes! I used Visual Studio Code and opened my terminal there. To see my Starship customization in action, I decided to try them out with the Vonage CLI. Here's how to install it:

npm install --location=global @vonage/cli

And here's what my output looked like:

The image shows the output of a package installation using npm. The terminal prompt displays the current time in purple and pink, a peach-colored location indicator, and a command running with the output message Completed in 191930ms highlighted in cyan.InstallNow here's my output after running vonage --version to check which version I had installed:

The image (version.png) displays the output for the version check of the Vonage CLI. The prompt includes the same colored elements as before, and the output shows the Vonage CLI and Node.js versions installed on the system.VersionNext I wanted to set my configurations for using Vonage. I got my API Key and API Secret from the Vonage Developer dashboard and then set them with the following command: vonage config:set --apiKey=XXXXXX --apiSecret=XXXXXX

The image shows the successful configuration of the Vonage CLI with an API key and secret. The output message Configuration saved confirms the action, and a deprecation warning for a module is also shown.ConfigTo check out my Vonage apps, I used: vonage apps

The image (apps.png) depicts an attempt to display Vonage applications, but it only shows the column headers Name and Id without any entries. A deprecation warning for the punycode module is repeated here as well.AppsMy terminal customization helped make everything easier!

For more information on how to create and manage your Vonage application, follow the documentation for the Vonage CLI or Michael Crump's blog "Better together: GitHub & Vonage CLI".

Conclusion

This blog taught us how to customize our macOS terminal using Starship and tested it with the Vonage CLI. As developers, our environment is key to our productivity, so why not make it as unique as the code we write? If you need help creating a pretty terminal, drop a message into our community Slack channel. If you end up following this tutorial, feel free to share your terminal on X, formerly known as Twitter, and tag me. I'd love to see your new environment!

Further Reading and Resources

Have a question or want to share what you're building?

Stay connected and keep up with the latest developer news, tips, and events.

Share:

https://a.storyblok.com/f/270183/384x384/b68093ec17/diana-pham.png
Diana PhamDeveloper Advocate

Diana is a developer advocate at Vonage. She likes eating fresh oysters.