Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! The prompt shows information you need while you're working, while staying sleek and out of the way.
## 🍬 特性
- 当上一个命令以非 0 状态退出时,提示字符会变为红色
- 非当前登录用户的用户名
- 当前 Java 版本(`☕`)
- 当前 Node.js 版本(`⬢`)
- 当前 Rust 版本 (`🦀`)
- 当前 Ruby 版本 (`💎`)
- 当前 Python 版本 (`🐍`)
- 当前 Go 版本 (`🐹`)
- Nix-shell 环境检测
- 显示环境变量
- 当前目录下现在的包版本 (`📦`)
- npm (Node.js)
- cargo (Rust)
- poetry (Python)
- 当前电池剩余容量与状态
- 当前 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
- 如果超过设定阈值,上一个命令的执行时间
- 后台运行进程数的指示器 (`✦`)
- 当前 Kubernetes Cluster 与 Namespace (`☸`)
- Current AWS profile (`☁️`)
## 🚀 安装
### 基础要求
- 安装有一个 [Powerline 字体](https://github.com/powerline/fonts) (如 [Fira Code](https://github.com/tonsky/FiraCode)) 并在您的终端启用 。
### 入门
1. 安装 **starship** 二进制文件:
如果您不使用下面的平台,你可以**[下载预编译的可执行文件](https://github.com/starship/starship/releases)**
#### Homebrew
```sh
$ brew install starship
```
#### Rust (v1.38 or higher)
```sh
$ cargo install starship
```
#### Arch Linux (AUR)
你可以使用 `starship` 这个名称在 AUR 上找到 Starship。 使用 `yay`或您最喜欢的 AUR helper 安装它。
```sh
$ yay -S starship
```
#### Nix (unstable)
```sh
$ nix-env --install starship
```
#### Termux
```sh
$ pkg install starship
```
#### Other x86-64 Linux Platforms
Download a prebuilt binary and place in /usr/local/bin/
```sh
$ wget -q --show-progress https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz
$ tar xvf starship-x86_64-unknown-linux-gnu.tar.gz
$ sudo mv starship /usr/local/bin/
```
1. 将初始化脚本添加到您的 shell 的配置文件:
#### Bash
在 `~/.bashhrc` 的最后,添加以下内容:
```sh
# ~/.bashrc
eval "$(starship init bash)"
```
#### Fish
在 `~/.config/fish/config.fish` 的最后,添加以下内容:
```sh
# ~/.config/fish/config.fish
eval (starship init fish)
```
#### Zsh
在 `~/.zshrc` 的最后,添加以下内容:
```sh
# ~/.zshrc
eval "$(starship init zsh)"
```
#### Powershell
Add the following to the end of `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` (or `~/.config/powershell/Microsoft.PowerShell_profile.ps1` on -Nix):
```sh
# ~\Documents\PowerShell\Profile.ps1
Invoke-Expression (&starship init powershell)
```
## 🔧 配置
For details on how to configure Starship, check out our [documentation](https://starship.rs/config/).
## 🤝 贡献
We are always looking for contributors of **all skill levels**! If you're looking to ease your way into the project, try out a [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue).
### 急需
- 👩💼 **项目经理**
- 我们有一个GitHub项目,有许多未经整理或没有被置于优先地位的新功能,还有许多想法没有被列入 issues。 我们需要人来为项目发展方向指路!
- 👩🎨 **设计师**
- 想制作吸引人的网站吗? 太棒了! 我们正想要制作一个漂亮的主页,以彰显 Starship 的与众不同。 帮助设计 Starship 的品牌是尝试你新点子的一个巨大机会!
- 👩💻 **Rust 开发者**
- 我们需要符合语言习惯的,高效的代码,需要性能优化与跨平台编译优化……你可以在这里收获_大量_的成果! 我 ([@matchai](https://github.com/matchai)) 是一枚 Rust 新手. 快来为我们指点迷津!
If you are interested in helping contribute to starship, please take a look at our [Contributing Guide](https://github.com/starship/starship/blob/master/CONTRIBUTING.md). Also, feel free to drop into our [Discord server](https://discord.gg/8Jzqu3T) and say hi. 👋
### 贡献者
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## 💭该项目受以下项目启发
Please check out these previous works that helped inspire the creation of 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.