starship — Cross-Shell Prompt
Linux / Modern CLI Tools / starship.html
💬 "starship command"
starship is a blazing-fast, cross-shell prompt. It replaces your default prompt to show the current folder, git branch and status, language versions, command runtime, and more—only what matters, clearly.
Written in Rust it updates with almost no lag even on slow shells, and a single config file customizes everything. It supports Bash, Zsh, Fish, and most other shells.
- Concept: Replaces the shell prompt (the part before your command) with a fast, informative one.
- Features: Shows git state, language versions, command duration, exit codes, and battery.
- Strength: Simple install and config, with the same look across shells and machines.
- Use when: You move between servers and shells and want a consistent, informative prompt.
Basic Usage
After installing the binary, add one init line to your shell rc file and you are done.
1. Shell integration (one rc line)
The installer adds it, or you add it yourself.
# Bash — at the end of ~/.bashrc
eval "$(starship init bash)"
# Zsh — in ~/.zshrc
eval "$(starship init zsh)"
2. See it in action
Folder and git state now appear in the prompt automatically.
cd ~/myrepo # branch and changes appear
git status # the git module summarizes state
3. Customize
Apply a preset or edit the config file.
starship preset presets/tomorrow-night -o ~/.config/starship.toml
$EDITOR ~/.config/starship.toml
Installation & Download
starship installs via the official script or a package manager.
| Environment | Command |
|---|---|
| Official installer (Linux/macOS) | curl -sS https://starship.rs/install.sh | sh |
| cargo | cargo install starship --locked |
| Ubuntu/Debian (if packaged) | sudo apt install starship |
| macOS (Homebrew) | brew install starship |
Verify with starship --version. You must add the eval "$(starship init shell)" line to your shell rc file for it to apply.
Common Commands
| Command / Key | Description |
|---|---|
starship preset | Apply a ready-made prompt style |
starship print-config | Show the current config |
starship explain | Explain each part of the prompt |
Config file ~/.config/starship.toml | Freely set modules, colors, and layout |
3 Essential Command Combinations
curl -sS https://starship.rs/install.sh | sh— Install starshipeval "$(starship init bash)"— Integrate the prompt into your shellstarship explain— Describe the current prompt components
💬 "Using starship on a real server"
A step-by-step look at setting up one prompt across many servers.
Step 1 · Install
Install with the official script.
curl -sS https://starship.rs/install.sh | sh
Step 2 · Shell integration
Add the init line to your rc file.
echo 'eval "$(starship init bash)"' >> ~/.bashrc
Step 3 · Apply
Open a new shell to see the prompt.
exec bash
git status
How it is used in practice
1. See git state at a glance
Situation — Watch branch and changes in the prompt.
cd /var/www/workspace
Result — The prompt shows the branch name and changed-file count.
Point — Avoid committing work on the wrong branch by mistake.
2. Consistent prompt everywhere
Situation — Use one style across servers.
starship preset presets/pure -o ~/.config/starship.toml
Result — Every server uses the same prompt style.
Point — Work with less confusion when hopping between environments.
Caveats
- It will not apply until the init line is added to your shell rc file.
- On very old shells/terminals some symbols may break; a Nerd Font displays them best.
- Config lives in
~/.config/starship.toml, which is easy to keep under version control.