Starship

轻量、迅速、客制化的高颜值终端!
仓库地址https://github.com/starship/starship
文档https://starship.rs/zh-CN/
平台 Apple

简介

兼容性优先

Starship 可以在常见的操作系统和 shell 上运行。 尝试着在各种地方使用它吧!

基于 Rust

Rust 特有的的速度与安全性,让你的提示尽可能的快速可靠。

客制化

每个小细节都可以按您喜欢的客制化,不论是最小化以求速度,还是更大以获得最完善的功能。

安装

前置要求

安装并在终端启用 Nerd Font 字体(如 Fira Code Nerd Font )。

安装 Starship

Windows

   MSI 安装包
Release 页面下载 msi 安装
   WinGet
shell
1
winget install --id Starship.Starship
   Scoop
shell
1
scoop install starship
Chocolatey    Chocolatey
shell
1
choco install starship

Linux

   通用安装脚本
shell
1
curl -sS https://starship.rs/install.sh | sh
   Deiban 13+
shell
1
2
3
4
# Debian Main
# https://sources.debian.org/src/starship/

apt install starship
   Ubuntu 25.04+
shell
1
2
3
# universe

apt install starship
   Arch Linux
shell
1
yay -S starship
   Alpine Linux 3.13+
shell
1
apk add starship

MacOS

   通用安装脚本
shell
1
curl -sS https://starship.rs/install.sh | sh
   Homebrew
shell
1
2
# brew update
brew install starship

配置 Shell,以启用 Starship

   PowerShell

将以下内容添加到 PowerShell 配置文件的末尾,通过运行 $PROFILE 来获取配置文件的路径

shell
1
Invoke-Expression (&starship init powershell)
   Bash

~/.bashrc 的最后,添加以下内容:

shell
1
eval "$(starship init bash)"
   Zsh

~/.zshrc 的最后,添加以下内容:

shell
1
eval "$(starship init zsh)"
完成后,打开一个新的 Shell 实例,你应该就能看到漂亮的 Shell 新提示符了。

高级配置(主题/细节修改)

预设主题:https://starship.rs/zh-CN/presets/

高级设置:https://starship.rs/zh-CN/config/

最后更新于