Starship is a minimal, fast, and customizable prompt for any shell. It provides useful context at a glance without cluttering your terminal.
Features #
- Fast - Written in Rust, renders in milliseconds
- Cross-shell - Works with zsh, bash, fish, and more
- Informative - Git status, tool versions, execution time
- Customizable - Extensive configuration options
Setup #
Installation #
Via mise (recommended):
mise install starship
Or direct install:
curl -sS https://starship.rs/install.sh | sh
Shell Integration #
Add to ~/.zshrc:
eval "$(starship init zsh)"
Configuration #
Config file: ~/.config/starship.toml
Minimal Setup #
# Don't print a new line at the start of the prompt
add_newline = false
# Replace the "β―" symbol in the prompt with "β"
[character]
success_symbol = "[β](bold green)"
error_symbol = "[β](bold red)"
Git Status #
Show detailed git information:
[git_status]
conflicted = "π³"
ahead = "ππ¨"
behind = "π°"
diverged = "π΅"
up_to_date = "β"
untracked = "π€·"
stashed = "π¦"
modified = "π"
staged = "[++\($count\)](green)"
renamed = "π
"
deleted = "π"
Tool Versions #
Show active tool versions:
[nodejs]
format = "via [π€ $version](bold green) "
[python]
format = "via [π $version](bold blue) "
[rust]
format = "via [π¦ $version](bold red) "
[golang]
format = "via [πΉ $version](bold cyan) "
Directory #
Customize how directories are displayed:
[directory]
truncation_length = 3
truncate_to_repo = true
Command Duration #
Show how long the last command took:
[cmd_duration]
min_time = 500
format = "took [$duration](bold yellow)"
Modules #
Starship supports many modules out of the box:
Development #
- git_branch - Current git branch
- git_commit - Current git commit
- git_state - Rebase/merge/cherry-pick state
- git_status - Working tree status
- package - Package version from package.json, Cargo.toml, etc.
Languages #
- nodejs - Node.js version
- python - Python version and virtualenv
- rust - Rust version
- golang - Go version
- ruby - Ruby version
- lua - Lua version
System #
- directory - Current directory
- hostname - System hostname
- username - Current user
- time - Current time
- battery - Battery percentage
- memory_usage - RAM usage
Tools #
- aws - AWS profile
- gcloud - Google Cloud region
- kubernetes - Current k8s context
- terraform - Terraform workspace
Conditional Formatting #
Show modules only in certain contexts:
[nodejs]
detect_extensions = ["js", "mjs", "cjs", "ts"]
detect_files = ["package.json", ".node-version"]
detect_folders = ["node_modules"]
Performance #
Starship is designed to be fast, but you can optimize further:
# Disable unused modules
[fill]
disabled = true
[line_break]
disabled = true
# Reduce git status checks
[git_status]
disabled = false
ahead = "β‘${count}"
diverged = "ββ‘${ahead_count}β£${behind_count}"
behind = "β£${count}"
Transient Prompt #
Keep previous prompts minimal:
[character]
success_symbol = "[β―](bold green)"
error_symbol = "[β―](bold red)"
# This requires shell-specific config
For zsh, add to ~/.zshrc:
# Transient prompt
setopt transient_rprompt
Troubleshooting #
Prompt not showing #
- Check starship is in PATH:
which starship - Verify init command is in shell config
- Restart shell:
exec zsh
Slow prompt #
Profile with: STARSHIP_LOG=trace starship prompt