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.
Why Starship over the alternatives
Section titled “Why Starship over the alternatives”- 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.
Installation
Section titled “Installation”brew install starshipcurl -sS https://starship.rs/install.sh | shwinget install --id Starship.StarshipAdd it to your shell
Section titled “Add it to your shell”-
Open your shell’s config file.
Terminal window echo 'eval "$(starship init bash)"' >> ~/.bashrcTerminal window echo 'eval "$(starship init zsh)"' >> ~/.zshrcTerminal window echo 'starship init fish | source' >> ~/.config/fish/config.fish -
Restart your shell, or source the config file directly:
Terminal window source ~/.zshrc -
You should immediately see the default Starship prompt, including your current directory and, if you’re in one, your git branch and status.
A solid starter config
Section titled “A solid starter config”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):
format = """$directory\$git_branch\$git_status\$cmd_duration$character"""
[directory]truncation_length = 3style = "bold cyan"
[git_branch]symbol = " "style = "bold purple"
[cmd_duration]min_time = 2000format = " 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.
Pairing it with a good terminal emulator
Section titled “Pairing it with a good terminal emulator”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.
Further reading
Section titled “Further reading”- Starship configuration reference — every module and option available.
- Nerd Fonts — patched fonts with the icon glyphs Starship’s presets expect.