Starship Prompt
Starship is a minimal, blazing-fast, and infinitely customizable prompt for any shell.
Project Homepage: Starship: Cross-Shell Prompt Documentation: Configuration | Starship
A Nerd Font in your terminal is recommended for the icons.
Installation #
Linux #
- Install the latest version for your system:
curl -sS https://starship.rs/install.sh | sh- Add the following to the end of
~/.bashrcor~/.zshrc:
eval "$(starship init bash)"
# -- or --
eval "$(starship init zsh)"macOS #
brew install starshipWindows #
winget install --id Starship.StarshipAdd to your PowerShell profile (code $PROFILE, see PowerShell Cheat-Sheet):
Invoke-Expression (&starship init powershell)Configuration #
Config lives in ~/.config/starship.toml.
| COMMAND | DESCRIPTION |
|---|---|
starship preset --list | List built-in presets |
starship preset nerd-font-symbols -o ~/.config/starship.toml | Apply a preset |
starship config | Open the config in $EDITOR |
starship explain | Explain each module shown in the current prompt |
starship timings | Which modules are slow |
starship bug-report | Gather details for an issue |
STARSHIP_CONFIG=~/alt.toml starship prompt | Use a different config file |
Example starship.toml:
add_newline = true
command_timeout = 500
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[✗](bold red)"
[directory]
truncation_length = 3
truncate_to_repo = true
[git_branch]
symbol = " "
[kubernetes]
disabled = false
format = '[$symbol$context( \($namespace\))]($style) '
[docker_context]
disabled = true
[cmd_duration]
min_time = 2000Tips #
- Disable modules you do not use, and set
command_timeoutto keep the prompt snappy in large repositories. - Modules for Kubectl context, Python venv and cloud accounts are off or lightweight by default. Enable what you need.