What Starship Does
- Git info — branch, status, stash, upstream
- Language versions — Node, Python, Rust, Go, Java, Ruby, PHP, .NET, etc.
- Cloud — AWS/GCP/Azure profile
- Kubernetes — current context + namespace
- Docker context — show active context
- Package version — auto-detect package.json, Cargo.toml, pyproject.toml
- Command duration — show time for slow commands
- Exit code — red on non-zero
- Custom modules — run any command and display output
Architecture
Starship runs as a subprocess on each prompt. Reads TOML config, collects context from environment + git + language detection + cloud CLIs, renders using a single starship prompt call. Aggressive caching keeps it below ~50ms.
Self-Hosting
CLI tool, self-contained Rust binary.
Key Features
- Universal (any shell)
- Single TOML config
- 100+ built-in modules
- Nerd Font symbol support
- Command duration
- Right prompt support
- Conditional rendering
- Highly customizable colors and formats
- Lightning fast (<50ms)
Comparison
| Prompt | Language | Shells | Speed | Config |
|---|---|---|---|---|
| Starship | Rust | All | Fastest | TOML |
| Powerlevel10k | Zsh | Zsh only | Very fast | Interactive |
| Spaceship | Zsh | Zsh only | Slow | zsh vars |
| pure | Zsh | Zsh only | Fast | zsh vars |
| oh-my-posh | Go | All | Fast | JSON/YAML/TOML |
常见问题 FAQ
Q: 和 Powerlevel10k? A: p10k 在 zsh 里速度略快(无子进程),但仅限 zsh。Starship 跨 shell,配置更简洁。都是好选择。
Q: 需要 Nerd Font 吗? A: 默认配置用 Unicode 符号。Nerd Font(JetBrainsMono Nerd Font 等)能获得更好的图标体验。
Q: 性能怎样?
A: Rust 写的,benchmark 一般 20-50ms。慢的话用 starship timings 诊断哪个 module 拖速度。
来源与致谢 Sources
- Docs: https://starship.rs
- GitHub: https://github.com/starship/starship
- License: ISC