Starship: A better terminal prompt in 2 minutes

Published 04-19-2024

Why use Starship

Starship is a minimal, fast, and highly customizable prompt for any shell.

  • Built-ins: Zero-setup modules. For example, the node js module will display the node version when a package.json is detected.
  • Configurable: Built-in modules and all aspects of your prompt can be configured
  • Easy to customize: Uses TOML as a configuration language and is very well documented

⚡ Follow the installation guide for your operating system to get started.

A Visually Efficient Prompt

One of my favorite features of Starship is how easy it is to move information above or to the right of your current line.

With a long folder and branch name, prompts tend to push your cursor far to the right. Starship solves this problem by providing the option to place your prompt above the cursor or place additional information to the right side of the terminal.

starship-gif

When using the right side, the prompt will intelligently hide the additional information when your current text collides with the right prompt.

Custom Modules

Starship makes it easy to make your own modules. For example, this module detects if tailwind css is present in a project. If it is present, append this sweet bird emoji.

[custom.tailwind]
detect_files = ['tailwind.config.cjs']
symbol = "🕊️"
format = "[$symbol]"

This is a very simple custom module. You could get more advanced by adding properties like command which can append the result of a command to your prompt.

Resources

Learn More

Real World Examples

⚡ If you enjoyed this article, consider checking out Flotes. It’s the Markdown note taking and study application we use to learn and research topics like the one in this article.

Fri Apr 19 2024