Terminal GuideTerminal Guide
starship icon

Starship

Shell Enhancements
macOSLinuxWindows
Rust

Minimal, fast, and customizable cross-shell prompt.

Official Website

Features

Cross-ShellFastCustomizableGit IntegrationLanguage Detection

Installation

Homebrew
brew install starship
Pacman (Arch)
pacman -S starship
Cargo (Rust)
cargo install starship

Why use Starship?

Lightning fast

Written in Rust, the prompt renders extremely fast. No need to worry about startup time.

Cross-shell support

Works with Bash, Zsh, Fish, PowerShell, Ion, Elvish, and virtually all shells.

Easy customization

Intuitive customization with TOML configuration files. No complex scripts needed.

Rich information display

Git, programming language versions, cloud environments, and more info automatically displayed.

Installation

Starship can be installed with various package managers and installation scripts.

Installation commands
# macOS (Homebrew)
brew install starship

# Linux (curl)
curl -sS https://starship.rs/install.sh | sh

# Cargo (Rust)
cargo install starship --locked

# Windows (Scoop)
scoop install starship

# Windows (winget)
winget install --id Starship.Starship

Shell Configuration

After installation, add the following to your shell configuration file.

Zsh (~/.zshrc)

~/.zshrc
# Initialize Starship
eval "$(starship init zsh)"

Bash (~/.bashrc)

~/.bashrc
# Initialize Starship
eval "$(starship init bash)"

Fish (~/.config/fish/config.fish)

~/.config/fish/config.fish
# Initialize Starship
starship init fish | source

PowerShell

$PROFILE
# Add to profile ($PROFILE)
Invoke-Expression (&starship init powershell)

Customization

Create the configuration file at ~/.config/starship.toml.

Basic configuration example

~/.config/starship.toml
# Configure the whole prompt
format = """
$username$hostname$directory$git_branch$git_status$cmd_duration$line_break$character"""

# Show command execution time (if it takes more than 2 seconds)
[cmd_duration]
min_time = 2_000
format = "took [$duration]($style) "
style = "yellow bold"

# Directory display
[directory]
truncation_length = 3
truncate_to_repo = true
style = "cyan bold"

# Git branch display
[git_branch]
symbol = " "
format = "on [$symbol$branch]($style) "
style = "purple bold"

# Git status
[git_status]
format = '([[$all_status$ahead_behind]]($style) )'
style = "red bold"

# Prompt character
[character]
success_symbol = "[❯](green bold)"
error_symbol = "[❯](red bold)"

Programming language version display

~/.config/starship.toml
# Node.js
[nodejs]
format = "via [$symbol($version )]($style)"
symbol = " "

# Python
[python]
format = 'via [$symbol$pyenv_prefix($version )(($virtualenv) )]($style)'
symbol = " "

# Rust
[rust]
format = "via [$symbol($version )]($style)"
symbol = " "

# Go
[golang]
format = "via [$symbol($version )]($style)"
symbol = " "

Prompt examples

Examples of how Starship prompts are displayed.

# Display example inside a Git repository
~/projects/myappon main[!?]took 3s
|
# When the previous command exits with an error
~/projects/myappon feature/auth[+2 ~1]
|
# Inside a Node.js project
~/projects/web-appon mainvia v20.10.0
|

Git status symbol meanings

?Untracked files
!Modified
+Staged
~Renamed
-Deleted
Waiting to push
Waiting to pull
Diverged

Tips

Use presets

With official presets, you can quickly start using a beautiful-looking prompt.

Apply presets
# View available presets
starship preset --list

# Apply Nerd Font Symbols preset
starship preset nerd-font-symbols -o ~/.config/starship.toml

# Apply Tokyo Night preset
starship preset tokyo-night -o ~/.config/starship.toml

Display configuration information

You can check the current settings and default configuration.

Check configuration
# Display current configuration
starship config

# Output default configuration for all modules
starship print-config --default

Disable specific modules

You can disable unwanted information by setting disabled = true.

~/.config/starship.toml
# Disable AWS display
[aws]
disabled = true

# Disable package version
[package]
disabled = true

Install Nerd Font

To display icons correctly, you need to install a Nerd Font and use it in your terminal. Recommended fonts include JetBrainsMono Nerd Font, FiraCode Nerd Font, and Hack Nerd Font. You can download them from the Nerd Fonts official website.

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More