How to install Starship on macOS/Linux: configure starship.toml for zsh and fish
Install Starship, tune starship.toml, and enable a cross-shell prompt in zsh or fish.
When you need Git branch, path depth, and command duration in one glance, the default PS1 is often too sparse or messy. Starship is a Rust cross-shell prompt: one init line hooks into zsh or fish, with settings in ~/.config/starship.toml. This guide covers official installs on macOS and Linux plus first-time tuning for hereink readers who live in the terminal.
The query is how to install Starship on macOS/Linux and configure zsh or fish. You should finish with the binary installed, init lines in place, a working starship.toml, and a prompt that shows Git and slow-command timing.
What Starship fixes
Easier than hand-rolled PS1
Raw PS1 escape sequences are hard to read and share. Starship modules (directory, git_branch, cmd_duration) live in TOML—you change themes without shell scripts.
Same look across shells
zsh on macOS, bash on a remote box, fish locally: one starship.toml keeps the prompt consistent and cuts context switching.
Official docs:
starship.rs. After install runstarship --version; the Configuration page documents every module.
Install on macOS and Linux
- 1macOS (Homebrew, recommended)
Run
brew install starship. Verify withwhich starshipandstarship --version. Same formula on Apple Silicon and Intel. - 2Linux distro packages
Debian/Ubuntu: add the official repo then
apt install starship(see the install page on starship.rs). Fedora:dnf install starship. Arch:pacman -S starshipor AUR. - 3Universal install script
No package manager:
curl -sS https://starship.rs/install.sh | sh. The script prints the bin path; you usually need~/.local/binon PATH. - 4Optional: cargo
With Rust installed:
cargo install starship --locked. Slower compile, useful when prebuilt binaries are unavailable.
Hook into zsh or fish
# zsh — append to ~/.zshrc
eval "$(starship init zsh)"
# fish — append to ~/.config/fish/config.fish
starship init fish | source
# bash — append to ~/.bashrc if you use bash
eval "$(starship init bash)"Save, then open a new terminal or source the file. If nothing changes, confirm starship is on PATH (echo $PATH).
Edit ~/.config/starship.toml
| Module | Role | Example |
|---|---|---|
[directory] | Current path, can truncate | truncation_length = 3 |
[git_branch] | Git branch and state | symbol = " " |
[cmd_duration] | Slow command timing | min_time = 500 (ms) |
format | Global module order | format = "$directory$git_branch$character" |
- Fits
- Daily coding in zsh/fish, hopping Git repos, wanting a lightweight prompt you can version-control.
- Does not fit
- Jump hosts that mandate legacy PS1; terminals that cannot use Nerd Fonts and reject plain-text symbols.
command not found: starship after install?
The binary is not on PATH. Homebrew users: eval "$(/opt/homebrew/bin/brew shellenv)" on Apple Silicon or check /usr/local/bin. install.sh users: export ~/.local/bin in .zshrc.
Does it clash with Oh My Zsh themes?
Disable or comment ZSH_THEME when Starship is active—keep only the starship init line or prompts may stack.
Config changes do nothing?
Edit ~/.config/starship.toml, not a copy in a project folder. TOML errors fall back to defaults; run starship config or see Troubleshooting in the docs.
Then align on one diagram
Once the shell feels right, service boundaries still belong on one shared board. See how to create a space.