Starship – Cross-shell prompt

GitHub Actions workflow status Crates.io version Packaging status
All Contributors Chat on Discord


網站 · 安裝 · 設定

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

Starship 是一個可以用於任何 shell、極小、極快、可高度客製化的提示字元!
這個提示字元顯示你工作時需要的資訊,同時又順暢又不會打擾你。


Starship with iTerm2 and the Snazzy theme

## 🍬 特色 - 如果最近一個指令結束時回傳非零的代碼,提示字元將轉成紅色 - 會在使用者與登入的使用者不同時顯示使用者名稱 - 現在的 Java 版本 (`☕`) - 現在的 Node.js 版本 (`⬢`) - 現在的 Rust 版本 (`🦀`) - 現在的 Ruby 版本 (`💎`) - 現在的 Python 版本 (`🐍`) - 現在的 Go 版本 (`🐹`) - 偵測 Nix-shell 的環境 - 印出環境變數 - 現在資料夾中的組件 (package) 版本 (`📦`) - npm (Node.js) - cargo (Rust) - poetry (Python) - 現在的電池電量與狀態 - 現在的 Git branch 與豐富的程式庫 (repository) 狀態: - `=` — 修改衝突 - `⇡` — 超前遠端 (remote) branch - `⇣` — 落後遠端 (remote) branch - `⇕` — 修改發散 (diverge) - `?` — 修改未追蹤 - `$` — 隱藏的 (stashed) 修改 - `!` — 修改過的檔案 - `+` — 新增的檔案 - `»` — 重新命名的檔案 - `✘` — 刪除的檔案 - 最近的指令花費的時間 (如果超過某個預先設定的門檻) - 標註背景執行的工作 (`✦`) - 現在的 Kubernetes 叢集以及名稱空間 (Namespace) (`☸`) - 目前的 AWS 配置 (`☁️`) ## 🚀 安裝 ### 先決要求 - 一個已經安裝並在你的終端機內啟動的 [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 或更高版本) ```sh $ cargo install starship ``` #### Arch Linux (AUR) Starship 在 AUR 中已經以 `starship` 這個名字存在。 請使用 `yay` 或你喜歡的 AUR 幫手安裝。 ```sh $ yay -S starship ``` #### Nix (不穩定) ```sh $ nix-env --install starship ``` #### Termux ```sh $ pkg install starship ``` #### 其他 x86-64 Linux 平台 下載一個預先建立好的執行檔,並放在 /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. 將初始化腳本 (script) 加入你的 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 將以下內容放到 `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` 的結尾 (或是在 -Nix 上的 `~/.config/powershell/Microsoft.PowerShell_profile.ps1`): ```sh # ~\Documents\PowerShell\Profile.ps1 Invoke-Expression (&starship init powershell) ``` ## 🔧 設定 關於如何設定 Starship,請看 [文件](https://starship.rs/zh-TW/config/) 。 ## 🤝 貢獻 我們歡迎具有**各式各樣能力**的貢獻者! 如果你正在尋找容易加入的方法,試試看標註為「[good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue)」的 issue。 ### 高優先需求 - 👩‍💼 **專案管理員** - 我們有一個 GitHub 專案以及許多尚未整理/排序的功能,甚至還有點子尚未被製作成 issue。 Starship 需要有人掌管產品的方向! - 👩‍🎨 **設計師** - 喜歡製作吸睛的網站? 超讚! 我們正在想辦法建立一個漂亮的 landing page 來展示 Starship 的美妙。 幫助設計 Starship 的商標正好是一個試驗新點子的機會! - 👩‍💻 **Rust 開發者** - 當正在寫慣用的 Rust 程式碼、設計高效的 Rust 程式架構、效能優化、跨平台建置優化、以及其他很多東西時,可以在這裡看到_許多_唾手可得的東西! 我 ([@matchai](https://github.com/matchai)) 是一個 Rust 新手。 來為我們指出正確的方向吧! 如果你對貢獻 Starship 有興趣,請看我們的 [貢獻指南](https://github.com/starship/starship/blob/master/CONTRIBUTING.md) 。 另外,請不用客氣加入我們的 [Discord 伺服器](https://discord.gg/8Jzqu3T) 並來問候一下。 👋 ### 貢獻者們 感謝這些優秀的人們 ([表情符號索引](https://allcontributors.org/docs/en/emoji-key)):
Matan Kushner
Matan Kushner

💻 🎨 🤔 🚇 🚧 👀 ⚠️
John Letey
John Letey

💻 🤔 👀 ⚠️
Tim Mulqueen
Tim Mulqueen

💻 🤔 👀 ⚠️
Tiffany Le-Nguyen
Tiffany Le-Nguyen

🤔 🚧 👀 📖
​Snuggle
​Snuggle

🎨 🤔 🚧 👀
Ryan Leckey
Ryan Leckey

👀
Youssef Habri
Youssef Habri

💻
Kevin Song
Kevin Song

🐛 💻 📖 ⚠️
Andrew Dassonville
Andrew Dassonville

🐛 💻
MaT1g3R
MaT1g3R

💻 📖 ⚠️
André Zanellato
André Zanellato

💻 📖 ⚠️
Saghm Rossi
Saghm Rossi

💻 📖 ⚠️
Shu Kutsuzawa
Shu Kutsuzawa

💻 📖 ⚠️ 🌍
Saurav Sharma
Saurav Sharma

💻 📖
Thomas O'Donnell
Thomas O'Donnell

💻 ⚠️ 📖 👀
Bruno Bigras
Bruno Bigras

💻 👀
Neil Kistner
Neil Kistner

💻 ⚠️ 👀
Quinn Strahl
Quinn Strahl

💻 ⚠️
Titouan Vervack
Titouan Vervack

💻 ⚠️
Francisco Lopes
Francisco Lopes

💻
Andrew Houts
Andrew Houts

💻 📖 ⚠️
Nick Young
Nick Young

💻 📖 ⚠️ 👀
Gabriel de Perthuis
Gabriel de Perthuis

💻
Hofer-Julian
Hofer-Julian

📖
Yuji Ueki
Yuji Ueki

🖋 🌍
谢祯晖
谢祯晖

💻 📖 🌍 👀
Kutsuzawa Ryo
Kutsuzawa Ryo

👀 💻 ⚠️ 🌍
hdevalke
hdevalke

🤔
Kuba Clark
Kuba Clark

💻 📖 ⚠️
Gimbar
Gimbar

💻 ⚠️ 📖
Tom Hotston
Tom Hotston

💻 📖
Bijan Chokoufe Nejad
Bijan Chokoufe Nejad

💻 ⚠️ 👀
yuri
yuri

💻 📖 ⚠️
TsubasaKawajiri
TsubasaKawajiri

🌍
Ryo Yamashita
Ryo Yamashita

💻
Thomas Lee
Thomas Lee

💻
(´⌣`ʃƪ)
(´⌣`ʃƪ)

💻
Barnaby Keene
Barnaby Keene

💻
Keith Wade
Keith Wade

💻 ⚠️
LukeAI
LukeAI

📖
Zach Mertes
Zach Mertes

💻 📖 ⚠️
David Knaack
David Knaack

💻 📖 ⚠️
Carl Summers
Carl Summers

📖
Yushan Lin
Yushan Lin

🌍
Weihang Lo
Weihang Lo

🌍
pinshan
pinshan

🌍
Brian Low
Brian Low

💻 📖 ⚠️
這個專案遵守 [all-contributors](https://github.com/all-contributors/all-contributors) 規範。 歡迎任何種類的貢獻者! ## 💭 發想來自 請看之前這些幫助我們創造 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 的圖案提示字元。


Starship rocket icon

## 📝 許可 Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).
這個專案使用 [ISC](https://github.com/starship/starship/blob/master/LICENSE) 許可。