Skip to content

轻量、迅速、客制化的高颜值终端!

前置要求 ​

快速安装 ​

  1. 安装 starship 二进制文件:

    安装最新版本 ​

    使用 Shell 命令:

    sh
    curl -sS https://starship.rs/install.sh | sh

    要更新 Starship ,运行上面的脚本 将会在不改动 Starship 配置文件的情况下升级版本 将会在不改动 Starship 配置文件的情况下升级版本

    通过软件包管理器安装 ​

    使用 Homebrew:

    sh
    brew install starship

    使用 Winget:

    powershell
    winget install starship
  2. 将初始化脚本添加到您的 shell 的配置文件中:

    Bash ​

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

    sh
    # ~/.bashrc
    
    eval "$(starship init bash)"

    Fish ​

    在 ~/.config/fish/config.fish 的最后,添加以下内容:

    sh
    # ~/.config/fish/config.fish
    
    starship init fish | source

    Zsh ​

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

    sh
    # ~/.zshrc
    
    eval "$(starship init zsh)"

    PowerShell ​

    Add the following to the end of Microsoft.PowerShell_profile.ps1. You can check the location of this file by querying the $PROFILE variable in PowerShell. 将以下内容添加到 Microsoft.PowerShell_profile.ps1。 你可以在 PowerShell 通过 $PROFILE 变量来查询文件的位置。 对于 -Nix 来说,通常文件路径是 ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 或 ~/.config/powershell/Microsoft.PowerShell_profile.ps1。

    sh
    Invoke-Expression (&starship init powershell)

    Ion ​

    在 ~/.config/ion/initrc 的最后,添加以下内容:

    sh
    # ~/.config/ion/initrc
    
    eval $(starship init ion)

    Elvish ​

    Only elvish v0.18 or higher is supported.

    Add the following to the end of ~/.config/elvish/rc.elv (%AppData%\elvish\rc.elv on Windows):

    sh
    # ~/.elvish/rc.elv
    
    eval (starship init elvish)

    For elvish versions prior to v0.21.0 the config file might instead be ~/.elvish/rc.elv

    Tcsh ​

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

    sh
    # ~/.tcshrc
    
    eval `starship init tcsh`

    Nushell ​

    This will change in the future.

    仅支持 Nushell v0.96+。

    将以下内容添加到你的 Nushell 配置文件的末尾(在 Nushell 中运行 $nu.config-path 可以找到该文件):

    sh
    mkdir ($nu.data-dir | path join "vendor/autoload")
    starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")

    Xonsh ​

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

    sh
    # ~/.xonshrc
    
    execx($(starship init xonsh))

    Cmd ​

    您需要使用 Clink (v1.2.30+) 与 Cmd. 将以下文件添加到文件 starship.lua 中,并将此文件放置在 Clink脚本目录中:

    lua
    -- starship.lua
    
    load(io.popen('starship init cmd'):read("*a"))()