Skip to content

Customize Your Shell Prompt with Starship

Your shell prompt is the thing you look at hundreds of times a day. The default prompt in most shells tells you almost nothing — no git branch, no command duration, no context. Starship fixes that: it’s a single, fast, cross-shell prompt written in Rust that works the same way in Bash, Zsh, Fish, PowerShell, and more.

This guide walks through installing Starship and setting up a config that shows your current directory, git status, and command execution time — without slowing your shell down.

  • Fast. It’s written in Rust and designed to render in single-digit milliseconds, so it won’t make your shell feel sluggish.
  • Cross-shell. One config file (~/.config/starship.toml) works whether you’re in Bash, Zsh, Fish, or even PowerShell — handy if you jump between machines and shells.
  • Modular. Every piece of information (“module”) — git branch, language version, battery level, command duration — can be turned on, off, or restyled independently.
Terminal window
brew install starship
  1. Open your shell’s config file.

    Terminal window
    echo 'eval "$(starship init bash)"' >> ~/.bashrc
  2. Restart your shell, or source the config file directly:

    Terminal window
    source ~/.zshrc
  3. You should immediately see the default Starship prompt, including your current directory and, if you’re in one, your git branch and status.

Create ~/.config/starship.toml with the following to get a clean prompt that shows your directory, git info, and how long the last command took (once it’s over 2 seconds — useful for spotting slow builds or scripts):

~/.config/starship.toml
format = """
$directory\
$git_branch\
$git_status\
$cmd_duration
$character"""
[directory]
truncation_length = 3
style = "bold cyan"
[git_branch]
symbol = " "
style = "bold purple"
[cmd_duration]
min_time = 2000
format = " took [$duration]($style)"
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[➜](bold red)"

Save the file and open a new shell (or run source ~/.zshrc / source ~/.bashrc again) to see it take effect.

Starship looks best in a terminal that renders Nerd Font icons and true color cleanly. If your current terminal is struggling with glyphs or feels slow to redraw, it might be worth a change — see our terminal emulator roundup for a side-by-side comparison of the most popular options.