
Share:
Diana is a developer advocate at Vonage. She likes eating fresh oysters.
Customize Your macOS Terminal Using Starship
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.
Demo of Customized Terminal
How to Set Up Starship
1. Install Starship
Open up a new Terminal window and run the following command:
Alternatively, if you have brew installed, you can do this instead:
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:
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:
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.
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:
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.
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.
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:
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 |
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:
And here's what my output looked like:
InstallNow here's my output after running vonage --version to check which version I had installed:
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
ConfigTo check out my Vonage apps, I used: vonage apps
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
Getting Started with Vonage CLI: Find out how to install and configure the Vonage CLI.
A Beginner’s Guide on How to Contribute to Open Source: A beginner's guide to contributing to open source projects, with practical steps and personal experiences to help newcomers get started.
10 Useful ChatGPT Prompts For Developers: Explore a curated collection of ChatGPT prompts designed to assist software developers in their daily tasks.
Have a question or want to share what you're building?
Subscribe to the Developer Newsletter
Follow us on X (formerly Twitter) for updates
Watch tutorials on our YouTube channel
Connect with us on the Vonage Developer page on LinkedIn
Stay connected and keep up with the latest developer news, tips, and events.