Github url

spaceship-prompt

by denysdovhan

denysdovhan /spaceship-prompt

:rocket::star: A Zsh prompt for Astronauts

12.4K Stars 719 Forks Last release: 11 months ago (v3.11.2) MIT License 945 Commits 54 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

spaceship โ†’~ prompt

๐Ÿš€โญ Spaceship ZSH

Zsh prompt for Astronauts.

[![NPM Version](https://img.shields.io/npm/v/spaceship-prompt.svg?style=flat-square)](https://npmjs.org/package/spaceship-prompt)[![CI Status](https://img.shields.io/travis/denysdovhan/spaceship-prompt.svg?style=flat-square)](https://travis-ci.org/denysdovhan/spaceship-prompt)[![Zsh Version](https://img.shields.io/badge/zsh-%3E%3Dv5.2-777777.svg?style=flat-square)](http://zsh.org/)[![Spaceship ZSH Twitter](https://img.shields.io/badge/twitter-%40SpaceshipZSH-00ACEE.svg?style=flat-square)](https://twitter.com/SpaceshipZSH)[![Donate](https://img.shields.io/badge/support-patreon-F96854.svg?style=flat-square)](https://patreon.com/denysdovhan)

Website | Install | Features | Options | API

Built with โค๏ธŽ by Denys Dovhan and contributors

Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt. It combines everything you may need for convenient work, without unnecessary complications, like a real spaceship.

Spaceship with Hyper and One Dark

Vist Troubleshooting for similar setup and find more examples with different color schemes in Screenshots wiki-page.

Features

  • Clever hostname and username displaying.
  • Prompt character turns red if the last command exits with non-zero code.
  • Current Git branch and rich repo status:

    ?

    โ€” untracked changes;

    ```
  • โ€” uncommitted changes in the index;
     - 
    !
    โ€” unstaged changes;
     - 
    ยป
    โ€” renamed files;
     - 
    โœ˜
    โ€” deleted files;
     - 
    $
    โ€” stashed changes;
     - 
    =
    โ€” unmerged changes;
     - 
    โ‡ก
    โ€” ahead of remote branch;
     - 
    โ‡ฃ
    โ€” behind of remote branch;
     - 
    โ‡• ``` โ€” diverged changes.
  • Current Mercurial bookmark/branch and rich repo status:

    ?

    โ€” untracked changes;

    ```
  • โ€” uncommitted changes in the index;
     - 
    !
    โ€” unstaged changes;
     - 
    โœ˜ ``` โ€” deleted files;
  • Indicator for jobs in the background (
    โœฆ
    ).
  • Current Node.js version, through nvm/nodenv/n (
    โฌข
    ).
  • Current Ruby version, through rvm/rbenv/chruby/asdf (
    ๐Ÿ’Ž
    ).
  • Current Elm version (
    ๐ŸŒณ
    )
  • Current Elixir version, through kiex/exenv/elixir (
    ๐Ÿ’ง
    ).
  • Current Swift version, through swiftenv (
    ๐Ÿฆ
    ).
  • Current Xcode version, through xenv (
    ๐Ÿ› 
    ).
  • Current Go version (
    ๐Ÿน
    ).
  • Current PHP version (
    ๐Ÿ˜
    ).
  • Current Rust version (
    ๐—ฅ
    ).
  • Current version of Haskell GHC Compiler, defined in stack.yaml file (
    ฮป
    ).
  • Current Julia version (
    เฎƒ
    ).
  • Current Docker version and connected machine (
    ๐Ÿณ
    ).
  • Current Amazon Web Services (AWS) profile (
    โ˜๏ธ
    ) (Using named profiles).
  • Current Google Cloud Platform gcloud active configuration (
    โ˜๏ธ
    ).
  • Current Python virtualenv.
  • Current Conda virtualenv (
    ๐Ÿ…’
    ).
  • Current Python pyenv (
    ๐Ÿ
    ).
  • Current .NET SDK version, through dotnet-cli (
    .NET
    ).
  • Current Ember.js version, through ember-cli (
    ๐Ÿน
    ).
  • Current Kubectl context (
    โ˜ธ๏ธ
    ).
  • Current Terraform workspace (
    ๐Ÿ› 
    ).
  • Package version, if there's is a package in current directory (
    ๐Ÿ“ฆ
    ).
  • Current battery level and status:

    โ‡ก
    • charging;
    • โ‡ฃ
    • discharging;
    • โ€ข
    • fully charged.
  • Current Vi-mode mode (with handy aliases for temporarily enabling).
  • Optional exit-code of last command (how to enable).
  • Optional time stamps 12/24hr in format (how to enable).
  • Execution time of the last command if it exceeds the set threshold.

Want more features? Please, open an issue or send pull request.

๐Ÿ’ก Tip: Follow our Twitter to keep yourself updated about new features, improvements, and bugfixes.

Requirements

To work correctly, you will first need:

Installing

Now that the requirements are satisfied, you can install Spaceship ZSH via any of the following tools.

๐Ÿ’ก Tip: If you like this project and want to get some stickers and postcards, consider becoming a patron:

Become a patron

npm

npm install -g spaceship-prompt

Done. This command should link

spaceship.zsh

as

prompt\_spaceship\_setup

to your

$fpath

and set

prompt spaceship

in

.zshrc

. Just reload your terminal.

๐Ÿ’ก Tip: Update Spaceship to new versions as you would any other package.

oh-my-zsh

Clone this repo:

git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH\_CUSTOM/themes/spaceship-prompt"

Symlink

spaceship.zsh-theme

to your oh-my-zsh custom themes directory:

ln -s "$ZSH\_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH\_CUSTOM/themes/spaceship.zsh-theme"

Set

ZSH\_THEME="spaceship"

in your

.zshrc

.

prezto

  • Follow prezto-contrib#usage to clone
    prezto-contrib
    to the proper location.
  • Enable the
    contrib-prompt
    module (before the
    prompt
    module).
  • Set
    zstyle ':prezto:module:prompt' theme 'spaceship'
    in your
    .zpreztorc
    .

zim

Add

zmodule denysdovhan/spaceship-prompt --name spaceship

to your

.zimrc

and run

zimfw install

.

antigen

Add the following snippet in your

~/.zshrc

:

antigen theme denysdovhan/spaceship-prompt

antibody

Update your

.zshrc

file with the following line:

antibody bundle denysdovhan/spaceship-prompt

zinit

Add the following line to your

~/.zshrc

where you're adding your other Zsh plugins:

zinit light denysdovhan/spaceship-prompt

zgen

Add the following line to your

~/.zshrc

where you're adding your other Zsh plugins:

zgen load denysdovhan/spaceship-prompt spaceship

zplug

Use this command in your

.zshrc

to load Spaceship as prompt theme:

zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme

Linux package manager

Arch Linux

Install the latest master from the AUR package [

spaceship-prompt-git

](https://aur.archlinux.org/packages/spaceship-prompt-git/):

git clone https://aur.archlinux.org/spaceship-prompt-git.git cd spaceship-prompt-git makepkg -si

Manual

If you have problems with approaches above, follow these instructions:

Example

Run

echo $fpath

to see possible location and link

spaceship.zsh

there, like:

$ ln -sf "$PWD/spaceship.zsh" "/usr/local/share/zsh/site-functions/prompt\_spaceship\_setup"

For a user-specific installation, simply add a directory to

$fpath

for that user in

.zshrc

:

fpath=( "$HOME/.zfunctions" $fpath )

Then install the theme like this:

$ ln -sf "$PWD/spaceship.zsh" "$HOME/.zfunctions/prompt\_spaceship\_setup"

For initializing prompt system add this to your

.zshrc

:

# .zshrc autoload -U promptinit; promptinit prompt spaceship

Customization

Spaceship works well out of the box, but you can customize almost everything if you want.

  • Options โ€” Tweak section's behavior with tons of options.
  • API โ€” Define a custom section that will do exactly what you want.

You have ability to customize or disable specific elements of Spaceship. All options must be overridden in your

.zshrc

file after the theme.

๐Ÿ’ก Tip: Take a look at popular option presets or share your own configuration on Presets wiki page.

Troubleshooting

Having trouble? Take a look at out Troubleshooting page.

Still struggling? Please, file an issue, describe your problem and we will gladly help you.

Related Projects

Here's a list of related projects that have been inspired by Spaceship ZSH.

  • matchai/spacefish - A port of Spaceship ZSH for fish shell intending to achieve complete feature parity.
  • starship/starship - A blazing-fast, cross-shell prompt written in Rust, heavily inspired by Spaceship ZSH.

Team

| Denys Dovhan | Salmanul Farzy | Maxim Baz | Runrioter Wung | | :------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | | Denys Dovhan | Salmanul Farzy | Maxim Baz | Runrioter Wung |

Donate

Hi! I work on this project in my spare time, in addition to my primary job. I hope you enjoy using Spaceship ZSH. If you do, please, become my patron ๐Ÿค.

| Patreon | Bitcoin | Ethereum | | :--------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | | Become a patron |

1FrPrQb6ACTkbSBAz9PduJWrDFfq41Ggb4

|

0x6aF39C917359897ae6969Ad682C14110afe1a0a1

| | | | |

This is your way make a clear statement: My work is valued.

I would appreciate your support! Thank you!

License

MIT ยฉ Denys Dovhan

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.