Starship — Cross-Shell Prompt
You are an expert in Starship, the minimal, blazing-fast, cross-shell prompt written in Rust. You help developers customize their terminal prompt with git status, language versions, cloud context, battery level, time, and custom modules — working identically across Bash, Zsh, Fish, PowerShell, and any shell with a single TOML config file.
Core Capabilities
Configuration
# ~/.config/starship.toml
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_status\
$nodejs\
$python\
$rust\
$golang\
$docker_context\
$kubernetes\
$aws\
$terraform\
$cmd_duration\
$line_break\
$character"""
[character]
success_symbol = "[❯](bold green)"
error_symbol = "[❯](bold red)"
[directory]
truncation_length = 3
truncate_to_repo = true
style = "bold cyan"
[git_branch]
symbol = "🌿 "
style = "bold purple"
[git_status]
conflicted = "⚔️ "
ahead = "⇡${count} "
behind = "⇣${count} "
diverged = "⇕⇡${ahead_count}⇣${behind_count} "
untracked = "?${count} "
stashed = "📦 "
modified = "!${count} "
staged = "+${count} "
deleted = "✘${count} "
[nodejs]
symbol = "⬢ "
detect_files = ["package.json", ".nvmrc"]
style = "bold green"
[python]
symbol = "🐍 "
detect_extensions = ["py"]
style = "bold yellow"
[rust]
symbol = "🦀 "
style = "bold red"
[docker_context]
symbol = "🐳 "
[kubernetes]
disabled = false
symbol = "☸ "
detect_files = ["k8s", "kubernetes"]
[aws]
symbol = "☁️ "
format = '[$symbol($profile )(\($region\))]($style)'
[cmd_duration]
min_time = 2000 # Show if command took >2s
format = "took [$duration]($style) "
style = "bold yellow"
[time]
disabled = false
format = "🕐 [$time]($style) "
time_format = "%H:%M"
# Custom module
[custom.docker_running]
command = "docker ps -q | wc -l | tr -d ' '"
when = "docker ps -q"
symbol = "🐳 "
format = "[$symbol$output containers]($style) "
style = "blue"
Installation
# macOS
brew install starship
# Linux
curl -sS https://starship.rs/install.sh | sh
# Add to shell:
# Bash: eval "$(starship init bash)" >> ~/.bashrc
# Zsh: eval "$(starship init zsh)" >> ~/.zshrc
# Fish: starship init fish | source >> ~/.config/fish/config.fish
Best Practices
- Cross-shell — Same config works in Bash, Zsh, Fish, PowerShell; switch shells without reconfiguring
- Lazy detection — Modules only show when relevant (Node.js only in JS projects); clean prompt by default
- Git status at a glance — Shows ahead/behind, modified, staged, untracked counts inline
- Command duration — Set
min_time = 2000 to show timing for slow commands; helps identify bottlenecks
- Cloud context — Show AWS profile, K8s context, Terraform workspace; never deploy to wrong environment
- Custom modules — Use
[custom.name] for any shell command output; docker containers, VPN status, etc.
- Presets — Start with a preset:
starship preset nerd-font-symbols -o ~/.config/starship.toml
- Performance — Written in Rust; renders in <10ms; never slows down your terminal
1---2name: starship3description: Starship — Cross-Shell Prompt4---5# Starship — Cross-Shell Prompt67You are an expert in Starship, the minimal, blazing-fast, cross-shell prompt written in Rust. You help developers customize their terminal prompt with git status, language versions, cloud context, battery level, time, and custom modules — working identically across Bash, Zsh, Fish, PowerShell, and any shell with a single TOML config file.89## Core Capabilities1011### Configuration1213```toml14# ~/.config/starship.toml15format = """16$username\17$hostname\18$directory\19$git_branch\20$git_status\21$nodejs\22$python\23$rust\24$golang\25$docker_context\26$kubernetes\27$aws\28$terraform\29$cmd_duration\30$line_break\31$character"""3233[character]34success_symbol = "[❯](bold green)"35error_symbol = "[❯](bold red)"3637[directory]38truncation_length = 339truncate_to_repo = true40style = "bold cyan"4142[git_branch]43symbol = "🌿 "44style = "bold purple"4546[git_status]47conflicted = "⚔️ "48ahead = "⇡${count} "49behind = "⇣${count} "50diverged = "⇕⇡${ahead_count}⇣${behind_count} "51untracked = "?${count} "52stashed = "📦 "53modified = "!${count} "54staged = "+${count} "55deleted = "✘${count} "5657[nodejs]58symbol = "⬢ "59detect_files = ["package.json", ".nvmrc"]60style = "bold green"6162[python]63symbol = "🐍 "64detect_extensions = ["py"]65style = "bold yellow"6667[rust]68symbol = "🦀 "69style = "bold red"7071[docker_context]72symbol = "🐳 "73only_with_files = true7475[kubernetes]76disabled = false77symbol = "☸ "78detect_files = ["k8s", "kubernetes"]7980[aws]81symbol = "☁️ "82format = '[$symbol($profile )(\($region\))]($style)'8384[cmd_duration]85min_time = 2000 # Show if command took >2s86format = "took [$duration]($style) "87style = "bold yellow"8889[time]90disabled = false91format = "🕐 [$time]($style) "92time_format = "%H:%M"9394# Custom module95[custom.docker_running]96command = "docker ps -q | wc -l | tr -d ' '"97when = "docker ps -q"98symbol = "🐳 "99format = "[$symbol$output containers]($style) "100style = "blue"101```102103## Installation104105```bash106# macOS107brew install starship108109# Linux110curl -sS https://starship.rs/install.sh | sh111112# Add to shell:113# Bash: eval "$(starship init bash)" >> ~/.bashrc114# Zsh: eval "$(starship init zsh)" >> ~/.zshrc115# Fish: starship init fish | source >> ~/.config/fish/config.fish116```117118## Best Practices1191201. **Cross-shell** — Same config works in Bash, Zsh, Fish, PowerShell; switch shells without reconfiguring1212. **Lazy detection** — Modules only show when relevant (Node.js only in JS projects); clean prompt by default1223. **Git status at a glance** — Shows ahead/behind, modified, staged, untracked counts inline1234. **Command duration** — Set `min_time = 2000` to show timing for slow commands; helps identify bottlenecks1245. **Cloud context** — Show AWS profile, K8s context, Terraform workspace; never deploy to wrong environment1256. **Custom modules** — Use `[custom.name]` for any shell command output; docker containers, VPN status, etc.1267. **Presets** — Start with a preset: `starship preset nerd-font-symbols -o ~/.config/starship.toml`1278. **Performance** — Written in Rust; renders in <10ms; never slows down your terminal