● starship Modules

479 2026-08-14 note β™‘οΈŽ

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:

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:

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.