Configure and optimize Starship cross-shell prompt with presets, custom modules, and performance tuning.
Manages complete Starship prompt configuration lifecycle including setup, customization, and optimization.
Check project structure:
config/starship/starship.toml (symlinked to ~/.config/starship.toml)starship.toml if presentconfig/fish/conf.d/30-starship.fish for hookflake.nix# Minimal starting point
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_status\
$cmd_duration\
$line_break\
$character"""
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[➜](bold red)"
[directory]
truncation_length = 3
truncate_to_repo = true
Available presets: nerd-font-symbols, pure-preset, pastel-powerline, tokyo-night, gruvbox-rainbow
# Preview preset
starship preset <preset-name> -o - | less
# Apply preset
starship preset <preset-name> -o ~/.config/starship.toml
Common modules to configure:
Language/Runtime:
[golang]
symbol = "🐹 "
format = "via [$symbol($version )]($style)"
[rust]
symbol = "🦀 "
format = "via [$symbol($version )]($style)"
[nodejs]
symbol = "⬢ "
format = "via [$symbol($version )]($style)"
[deno]
symbol = "🦕 "
format = "via [$symbol($version )]($style)"
Git:
[git_branch]
symbol = "🌱 "
format = "on [$symbol$branch]($style) "
[git_status]
conflicted = "🏳"
ahead = "⇡${count}"
behind = "⇣${count}"
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
untracked = "🤷"
stashed = "📦"
modified = "📝"
staged = '[++\($count\)](green)'
renamed = "👅"
deleted = "🗑"
Performance:
[cmd_duration]
min_time = 500
format = "took [$duration](bold yellow)"
[directory]
read_only = " 🔒"
# Show Kubernetes context when kubectl available
[kubernetes]
disabled = false
format = 'on [⛵ ($context \($namespace\))](dimmed green) '
# Show AWS profile
[aws]
format = 'on [$symbol($profile )]($style)'
symbol = "☁️ "
# Show Docker context
[docker_context]
format = "via [🐋 $context](blue bold)"
# Disable modules in large repos
[package]
disabled = true
[nodejs]
disabled = true # Only if not a Node project
# Timeout protection
[cmd_duration]
min_time = 500
show_milliseconds = false
[git_status]
disabled = false
# Limit git operations in large repos
ahead_behind_limit = 1000
scan_timeout = 30 # ms, default is 30
[directory]
scan_timeout = 10
# Validate TOML syntax
starship config
# Explain current config
starship explain
# Print configuration value
starship print-config
# Test in isolation
env STARSHIP_CONFIG=./test-config.toml fish
Prompt not appearing:
config/fish/conf.d/30-starship.fishstarship init fish | sourcetype -q starshipSlow prompt:
starship timingsModules missing:
kubectl for kubernetes module)disabled = false settingsConfig not loading:
echo $STARSHIP_CONFIG (should be unset or correct path)ls -la ~/.config/starship.tomlstarship configWhen modifying:
config/starship/starship.tomlexec fish -lls -la ~/.config/starship.tomlWhen creating new:
config/starship/starship.tomlscripts/link-config.sh handles starship symlink~/.config/starship.tomlWhen generating configs:
Use Edit tool for existing configs:
Use Write tool for new configs:
Include testing steps:
# Reload shell
exec fish -l
# Verify prompt renders
starship explain
# Check performance
starship timings
Essential modules (always include):
character - prompt symboldirectory - current pathgit_branch, git_status - git infocmd_duration - command timingLanguage modules (include based on project):
deno, nodejsgolangrustjavaContext modules (optional):
kubernetes - if using kubectldocker_context - if using Dockeraws - if using AWS CLIAvoid in performance-critical environments:
package - slow in large node_modulesThis is a Nix-based dotfiles repository:
flake.nixconfig/starship/starship.toml~/.config/starship.toml by scripts/link-config.shconfig/fish/conf.d/30-starship.fish