Starship – Cross-shell prompt

GitHub Actions workflow status Crates.io version Packaging status
加入 Discord 所有贡献者


网站 · 安装 · 配置

English   日本語   繁體中文   简体中文   Deutsch   Français   Русский

Starship 是轻量的,快速的,可以快速定制的,适用于任何 shell 的提示符!
它可以在不影响流畅性=的情况下,在你工作时展示你所需要的信息。


使用 iTerm 和 Snazz 主题的 Starship

## 🍬 特性 - 当上一个命令以非 0 状态退出时,提示字符会变为红色 - 当前 Go 版本 (`🐹`) - 当前 Java 版本(`☕`) - 当前 Node.js 版本(`⬢`) - Current PHP version (`🐘`) - 当前 Python 版本 (`🐍`) - 当前 Ruby 版本 (`💎`) - 当前 Rust 版本 (`🦀`) - Current .NET version (`•NET`) - 当前目录下现在的包版本 (`📦`) - npm (Node.js) - cargo (Rust) - poetry (Python) - composer (PHP) - 当前 Git 分支与一应俱全的仓库状态 - `=` — conflicting changes - `⇡` — ahead of remote branch - `⇣` — behind of remote branch - `⇕` — diverged changes - `?` — untracked changes - `$` — stashed changes - `!` — modified files - `+` — added files - `»` — renamed files - `✘` — deleted files - Current Mercurial branch - 当前电池剩余容量与状态 - `⇡` – charging - `⇣` – discharging - `•` – fully charged - 后台运行进程数的指示器 (`✦`) - 当前 Kubernetes Cluster 与 Namespace (`☸`) - Current Amazon Web Services (AWS) profile (`☁️`) - Execution time of the last command - Custom environment variable value - Nix-shell 环境检测 - 非当前登录用户的用户名 - Optional current time in 12/24hr format ## 🚀 安装 ### 基础要求 - 安装有一个 [Powerline 字体](https://github.com/powerline/fonts) (如 [Fira Code](https://github.com/tonsky/FiraCode)) 并在您的终端启用 。 ### 入门 1. 安装 **starship** 二进制文件: #### Install Latest Version ##### With Shell: ```sh curl -fsSL https://starship.rs/install.sh | bash ``` #### Install via Package Manager ##### With [Homebrew](https://brew.sh/): ```sh brew install starship ``` ##### With [Scoop](https://scoop.sh): ```powershell scoop install starship ``` 1. 将初始化脚本添加到您的 shell 的配置文件: #### Bash 在 `~/.bashhrc` 的最后,添加以下内容: ```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 添加 `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` (或者`~/.config/powershell/Microsoft.PowerShell_profile.ps1` on -Nix)到: ```sh # ~\Documents\PowerShell\Profile.ps1 Invoke-Expression (&starship init powershell) ``` #### Ion Add the following to the end of `~/.config/ion/initrc`: ```sh # ~/.config/ion/initrc eval $(starship init ion) ``` ## 🔧 配置 关于如何配置 Starship ,详情请查看我们的[文档](https://starship.rs/config/)。 ## 🤝 贡献 我们一直在寻找贡献者!你都可以参与贡献 ** 不论你的技能如何 **。 如果您希望快速为项目作出贡献,请尝试解决 [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue)。 ### 急需 - 👩‍💼 **项目经理** - 我们有一个GitHub项目,有许多未经整理或没有被置于优先地位的新功能,还有许多想法没有被列入 issues。 我们需要人来为项目发展方向指路! - 👩‍🎨 **设计师** - 想制作吸引人的网站吗? 太棒了! 我们正想要制作一个漂亮的主页,以彰显 Starship 的与众不同。 帮助设计 Starship 的品牌是尝试你新点子的一个巨大机会! - 👩‍💻 **Rust 开发者** - 我们需要符合语言习惯的,高效的代码,需要性能优化与跨平台编译优化……你可以在这里收获_大量_的成果! 我 ([@matchai](https://github.com/matchai)) 是一枚 Rust 新手. 快来为我们指点迷津! 如果您有兴趣贡献于 Starship,请查看我们的[贡献指南](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)。 另外,你可以自由加入我们的 [Discord 服务器](https://discord.gg/8Jzqu3T) 。 👋 ### 贡献者 感谢这些优秀的人 ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Matan Kushner

💻 🎨 🤔 🚇 🚧 👀 ⚠️

John Letey

💻 🤔 👀 ⚠️

Tim Mulqueen

💻 🤔 👀 ⚠️

Tiffany Le-Nguyen

🤔 🚧 👀 📖

​Snuggle

🎨 🤔 🚧 👀

Ryan Leckey

👀

Youssef Habri

💻

Kevin Song

🐛 💻 📖 ⚠️

Andrew Dassonville

🐛 💻

MaT1g3R

💻 📖 ⚠️

André Zanellato

💻 📖 ⚠️

Saghm Rossi

💻 📖 ⚠️

Shu Kutsuzawa

💻 📖 ⚠️ 🌍

Saurav Sharma

💻 📖

Thomas O'Donnell

💻 ⚠️ 📖 👀

Bruno Bigras

💻 👀

Neil Kistner

💻 ⚠️ 👀

Quinn Strahl

💻 ⚠️

Titouan Vervack

💻 ⚠️

Francisco Lopes

💻

Andrew Houts

💻 📖 ⚠️

Nick Young

💻 📖 ⚠️ 👀

Gabriel de Perthuis

💻

Hofer-Julian

📖

Yuji Ueki

🖋 🌍

谢祯晖

💻 📖 🌍 👀

Kutsuzawa Ryo

👀 💻 ⚠️ 🌍

hdevalke

🤔

Kuba Clark

💻 📖 ⚠️

Gimbar

💻 ⚠️ 📖

Tom Hotston

💻 📖

Bijan Chokoufe Nejad

💻 ⚠️ 👀

yuri

💻 📖 ⚠️

TsubasaKawajiri

🌍

Ryo Yamashita

💻

Thomas Lee

💻

(´⌣`ʃƪ)

💻

Barnaby Keene

💻

Keith Wade

💻 ⚠️

LukeAI

📖

Zach Mertes

💻 📖 ⚠️

David Knaack

💻 📖 ⚠️

Carl Summers

📖

Yushan Lin

🌍

Weihang Lo

🌍

pinshan

🌍

Brian Low

💻 📖 ⚠️

Matias Kotlik

💻

marblenix

🚇

Raidou

💻 ⚠️

Luca Greco

💻 📖 ⚠️

Luca Rinaldi

💻

Stephen Ball

💻 ⚠️ 📖

Qingping Hou

💻 📖 ⚠️

Dan Wendorf

💻 ⚠️

Alan Pope

🚇

BuggStream

💻 📖

Jon Grythe Stødle

💻 ⚠️

Jason Etcovitch

🐛

Etienne Mabille

💻

AppleTheGolden

💻 📖

Mike Sampson

💻 📖 ⚠️

Dominik Braun

💻
此项目遵循 [all-contributors](https://github.com/all-contributors/all-contributors) 标准。 任何形式的贡献都将受到欢迎! ## 💭该项目受以下项目启发 请参考这些曾经为 Starship 提供启发的工程。 🙏 - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts. - **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** - Cross-shell robbyrussell theme written in JavaScript. - **[reujab/silver](https://github.com/reujab/silver)** - A cross-shell customizable powerline-like prompt with icons.


Starship rocket icon

## 📝 License Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).
This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed.