β starship Modules
starship provides modular prompt components that can be customized individually. Each module shows specific information when relevant.
Common Modules
Directory
[directory]
truncation_length = 3
truncate_to_repo = true
Git Branch
[git_branch]
symbol = "π± "
truncation_length = 20
Git Status
[git_status]
conflicted = "π³"
ahead = "ππ¨"
behind = "π°"
diverged = "π΅"
untracked = "π€·"
stashed = "π¦"
modified = "π"
staged = "ποΈ"
renamed = "π"
deleted = "ποΈ"
Node.js
[nodejs]
symbol = "β¬’ "
detect_files = ["package.json", ".node-version"]
detect_folders = ["node_modules"]
Python
[python]
symbol = "π "
pyenv_version_name = true
detect_files = ["requirements.txt", ".python-version", "pyproject.toml"]
Rust
[rust]
symbol = "π¦ "
detect_files = ["Cargo.toml"]
Go
[golang]
symbol = "πΉ "
detect_files = ["go.mod", "go.sum"]
Advanced Modules
Custom Modules
[custom.foo]
when = "test -f foo.txt"
symbol = "π₯ "
style = "bold red"
description = "foo.txt exists"
Environment Variables
[env_var]
variable = "MY_ENV_VAR"
symbol = "π "
style = "bold yellow"
Time
[time]
disabled = false
format = "π [$time]($style) "
time_format = "%T"
Username
[username]
show_always = true
style_user = "bold red"
style_root = "bold black"
Hostname
[hostname]
ssh_only = true
format = "on [$hostname](bold red) "
Module Detection
Most modules support file and folder detection:
[nodejs]
detect_files = ["package.json", ".node-version"]
detect_folders = ["node_modules"]
detect_extensions = ["js", "ts", "jsx"]
Module Styling
Each module supports style strings:
[directory]
style = "bold cyan"
Style options:
- Colors:
black,red,green,yellow,blue,magenta,cyan,white - Modifiers:
bold,dim,italic,underline - Background:
bg:color
Module Order
Control the order of modules in the prompt:
format = """
[ββββββββββββββββββββ>](bold green)
[β](bold green) $directory$git_branch$git_status
[β](bold green) $nodejs$python$rust$golang
[ββ>](bold green) $character
"""
Right Prompt
Enable a right-side prompt:
right_format = "$time"
Module Configuration
Each module can be:
- Disabled globally:
disabled = true - Conditionally enabled:
when = "command" - Customized with symbols, styles, and formats
Modules make starship flexible and informative while keeping the prompt clean and relevant.
For overall starship configuration, see starship Configuration. For the main starship overview, see starship.
- Links to
- starship Β· starship Configuration Β· starship
- Linked from
- starship Configuration Β· starship