starship/starship

GitHub: starship/starship

一款轻量、极速、高度可定制的跨平台 Shell 提示符,支持多种 Shell 和操作系统。

Stars: 55505 | Forks: 2438

Starship – Cross-shell prompt

GitHub Actions workflow status Crates.io version Packaging status
Chat on Discord Follow @StarshipPrompt on Twitter Stand With Ukraine

网站 · 安装 · 配置

English   Deutsch   Español   Français   Bahasa Indonesia   Italiano   日本語   Português do Brasil   Русский   Українська   Tiếng Việt   简体中文   繁體中文

Starship with iTerm2 and the Snazzy theme **轻量、极速、无限可定制的各种 Shell 提示符!** - **极速**:它很快 – _真的非常_ 快! 🚀 - **可定制**:配置提示符的方方面面。 - **通用**:适用于任何操作系统上的任何 Shell。 - **智能**:一目了然地显示相关信息。 - **功能丰富**:支持所有你喜欢的工具。 - **易用**:快速安装 – 几分钟内即可开始使用。

探索 Starship 文档  ▶

## 🚀 安装 ### 前置条件 - 在终端中安装并启用 [Nerd Font](https://www.nerdfonts.com/)(例如,尝试使用 [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads))。 ### 步骤 1. 安装 Starship 从下面的列表中选择你的操作系统以查看安装说明:
Android 使用以下任意包管理器安装 Starship: | Repository | Instructions | | ---------- | ---------------------- | | [Termux] | `pkg install starship` |
BSD 使用以下任意包管理器安装 Starship: | Distribution | Repository | Instructions | | ------------ | --------------- | --------------------------------- | | **_Any_** | **[crates.io]** | `cargo install starship --locked` | | FreeBSD | [FreshPorts] | `pkg install starship` | | NetBSD | [pkgsrc] | `pkgin install starship` |
Linux 为你的系统安装最新版本: ``` curl -sS https://starship.rs/install.sh | sh ``` 或者,使用以下任意包管理器安装 Starship: | Distribution | Repository | Instructions | | ------------------ | ----------------------- | ------------------------------------------------------------- | | **_Any_** | **[crates.io]** | `cargo install starship --locked` | | _Any_ | [conda-forge] | `conda install -c conda-forge starship` | | _Any_ | [Linuxbrew] | `brew install starship` | | Alpine Linux 3.13+ | [Alpine Linux Packages] | `apk add starship` | | Arch Linux | [Arch Linux Extra] | `pacman -S starship` | | CentOS 7+ | [Copr] | `dnf copr enable atim/starship`
`dnf install starship` | | Debian 13+ | [Debian Main] | `apt install starship` | | Fedora 40+ | [Copr] | `dnf copr enable atim/starship`
`dnf install starship` | | Gentoo | [Gentoo Packages] | `emerge app-shells/starship` | | Manjaro | | `pacman -S starship` | | NixOS | [nixpkgs] | `nix-env -iA nixpkgs.starship` | | openSUSE | [OSS] | `zypper in starship` | | Ubuntu 25.04+ | [Ubuntu Universe] | `apt install starship` | | Void Linux | [Void Linux Packages] | `xbps-install -S starship` |
macOS 为你的系统安装最新版本: ``` curl -sS https://starship.rs/install.sh | sh ``` 或者,使用以下任意包管理器安装 Starship: | Repository | Instructions | | --------------- | --------------------------------------- | | **[crates.io]** | `cargo install starship --locked` | | [conda-forge] | `conda install -c conda-forge starship` | | [Homebrew] | `brew install starship` | | [MacPorts] | `port install starship` |
Windows 使用 [releases section](https://github.com/starship/starship/releases/latest) 中的 MSI 安装程序为你的系统安装最新版本。 使用以下任意包管理器安装 Starship: | Repository | Instructions | | --------------- | --------------------------------------- | | **[crates.io]** | `cargo install starship --locked` | | [Chocolatey] | `choco install starship` | | [conda-forge] | `conda install -c conda-forge starship` | | [Scoop] | `scoop install starship` | | [winget] | `winget install --id Starship.Starship` |
### 步骤 2. 设置 Shell 以使用 Starship 配置你的 Shell 以初始化 starship。从下面的列表中选择你使用的 Shell:
Bash 将以下内容添加到 `~/.bashrc` 的末尾: ``` eval "$(starship init bash)" ```
Cmd 你需要在 Cmd 中使用 [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+)。 在路径 `%LocalAppData%\clink\starship.lua` 下创建一个文件,内容如下: ``` load(io.popen('starship init cmd'):read("*a"))() ```
Elvish 将以下内容添加到 `~/.config/elvish/rc.elv`(Windows 上为 `%AppData%\elvish\rc.elv`)的末尾: ``` eval (starship init elvish) ``` 注意:仅支持 Elvish v0.18+。对于 v0.21.0 之前的 elvish 版本,配置文件路径可能是 `~/.elvish/rc.elv`
Fish 将以下内容添加到 `~/.config/fish/config.fish` 的末尾: ``` starship init fish | source ```
Ion 将以下内容添加到 `~/.config/ion/initrc` 的末尾: ``` eval $(starship init ion) ```
Nushell 将以下内容添加到你的 Nushell 配置文件的末尾(在 Nushell 中运行 `$nu.config-path` 查找它): ``` mkdir ($nu.data-dir | path join "vendor/autoload") starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu") ``` 注意:仅支持 Nushell v0.96+
PowerShell 将以下内容添加到你的 PowerShell 配置文件的末尾(通过运行 `$PROFILE` 查找它): ``` Invoke-Expression (&starship init powershell) ```
Tcsh 将以下内容添加到 `~/.tcshrc` 的末尾: ``` eval `starship init tcsh` ```
Xonsh 将以下内容添加到 `~/.xonshrc` 的末尾: ``` execx($(starship init xonsh)) ```
Zsh 将以下内容添加到 `~/.zshrc` 的末尾: ``` eval "$(starship init zsh)" ```
### 步骤 3. 配置 Starship 启动一个新的 Shell 实例,你应该能看到你漂亮的新 Shell 提示符了。 如果你对默认设置满意,就可以开始使用了! 如果你想进一步自定义 Starship: - **[Configuration](https://starship.rs/config/)** – 学习如何配置 Starship 以根据你的喜好调整提示符 - **[Presets](https://starship.rs/presets/)** – 从他人构建好的配置中获取灵感 ## 💭 灵感来源 请查看这些帮助启发了 starship 创建的前期作品。 🙏 - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** – 专为宇航员打造的 ZSH 提示符。 - **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** – 使用 JavaScript 编写的跨 Shell robbyrussell 主题。 - **[reujab/silver](https://github.com/reujab/silver)** – 带有图标的跨 Shell 可定制 powerline 风格提示符。 ## 🔒 代码签名策略 由 [SignPath.io] 提供免费代码签名,证书由 [SignPath Foundation] 提供。 代码签名角色: - 审查者:[Astronauts](https://github.com/orgs/starship/teams/astronauts) - 批准者和作者:[Mission Control](https://github.com/orgs/starship/teams/mission-control) 除非用户或安装/操作人员特别要求,否则本程序不会将任何信息传输到其他网络系统。


Starship rocket icon

## 📝 许可证 版权所有 © 2019 至今,[Starship Contributors](https://github.com/starship/starship/graphs/contributors)。
本项目基于 [ISC](https://github.com/starship/starship/blob/master/LICENSE) 许可证授权。
标签:Awesome, Bash, CLI, Fish, HTTP 参数枚举, IPv6, PowerShell, Prompt 自定义, Python安全, Rust, Shell 提示符, WiFi技术, Zsh, 可视化界面, 威胁情报, 开发者工具, 极简主义, 系统管理, 终端美化, 网络流量审计, 通知系统