Skip to main content

Awesome Starship Prompt

· 2 min read
Max Kaido
Architect

The minimal, blazing-fast, and infinitely customizable prompt for any shell!

🌟 Key Features

  1. Universal Shell Support

    • Works with any shell
    • Consistent experience
    • Cross-platform compatibility
    • Easy configuration
  2. Performance

    • Written in Rust
    • Asynchronous execution
    • Minimal overhead
    • Smart caching
  3. Customization

    • TOML configuration
    • Modular design
    • Custom commands
    • Conditional rendering
  4. Smart Defaults

    • Intelligent module activation
    • Context-aware display
    • Sensible fallbacks
    • Auto-detection

⚡ Quick Start

# Installation
curl -sS https://starship.rs/install.sh | sh

# Add to your shell config (~/.zshrc, ~/.bashrc, etc.)
eval "$(starship init zsh)" # or bash, fish, etc.

🎨 Essential Configuration

# ~/.config/starship.toml

# Performance-Optimized Setup
format = """$directory$git_branch$git_status$nodejs$python$character"""
command_timeout = 1000
scan_timeout = 100

[directory]
style = "blue bold"
truncation_length = 3
truncate_to_repo = true
read_only = " "

[character]
success_symbol = "[❯](purple)"
error_symbol = "[❯](red)"
vicmd_symbol = "[❮](green)"

[git_branch]
format = "[$branch]($style) "
style = "bright-black"

[git_status]
format = '([\[$all_status$ahead_behind\]]($style) )'
style = "cyan"
ahead = "⇡"
behind = "⇣"
diverged = "⇕"
modified = "!"
staged = "+"
renamed = "»"
deleted = "✘"

[nodejs]
format = "[$version]($style) "
style = "green"
detect_files = ["package.json", ".nvmrc"]
detect_extensions = ["js", "mjs", "cjs", "ts", "mts", "cts"]

[python]
format = "[$version]($style) "
style = "yellow"
detect_extensions = ["py"]
python_binary = ["python3", "python"]

# Disable unused modules for performance
[aws]
disabled = true

[gcloud]
disabled = true

[kubernetes]
disabled = true

[docker_context]
disabled = true

[package]
disabled = true

[ruby]
disabled = true

[java]
disabled = true

[golang]
disabled = true

[php]
disabled = true

[haskell]
disabled = true

[swift]
disabled = true

[rust]
disabled = true

🎯 Module Configuration

  1. Directory Module

    [directory]
    truncation_length = 3
    truncate_to_repo = true
    fish_style_pwd_dir_length = 1
    use_logical_path = true
  2. Git Module

    [git_branch]
    symbol = " "
    truncation_length = 4
    truncation_symbol = ""
    ignore_branches = ["master", "main"]
  3. Language Versions

    [nodejs]
    format = "via [ $version](bold green) "
    detect_extensions = ["js", "mjs", "cjs", "ts", "mts", "cts"]

    [python]
    format = "via [ $version]($style) "
    detect_extensions = ["py"]

🚀 Pro Tips

  1. Performance Optimization

    • Disable unused modules
    • Use minimal format string
    • Set appropriate timeouts
    • Cache aggressively
    • Use async rendering
  2. Style Guide

    # Consistent colors
    [git_branch]
    style = "242"
    [git_status]
    style = "cyan"
    [directory]
    style = "blue"
  3. Error Handling

    [character]
    error_symbol = "[✗](bold red)"
    success_symbol = "[❯](bold green)"
    vicmd_symbol = "[❮](bold green)"

🔧 Troubleshooting

  1. Common Issues

    • Font problems: Install Nerd Fonts
    • Performance: Check module timeouts
    • Missing icons: Verify terminal support
    • Shell integration: Check initialization
  2. Debugging

    # Enable debug logs
    STARSHIP_LOG=debug starship explain

    # Check configuration
    starship config

    # Profile startup time
    STARSHIP_LOG=trace starship explain 2>&1 | grep "took"

🎨 Theme Examples

  1. Minimal Development

    format = """$directory$git_branch$character"""
  2. Full Stack

    format = """
    $username@$hostname
    $directory$git_branch$git_status
    $nodejs$python$rust
    $character"""
  3. DevOps

    format = """
    $directory$git_branch
    $kubernetes$docker$aws
    $character"""

🔄 Integration

  1. Terminal Emulators

    • iTerm2
    • Alacritty
    • Windows Terminal
    • Kitty
  2. Color Schemes

    • Dracula
    • Nord
    • Solarized
    • One Dark
  3. Fonts

    • JetBrains Mono
    • Fira Code
    • Hack
    • Source Code Pro

📚 Resources

  1. Official

  2. Community