# Spaceship Prompt

> Customizable Zsh prompt that shows Git/Mercurial status, language runtime versions, Docker, Kubernetes, battery and more, with support for custom sections.

Stars: 20.6k · Language: Shell · License: MIT · Categories: Shell

- Repository: https://github.com/spaceship-prompt/spaceship-prompt
- Website: https://spaceship-prompt.sh
- Page: https://www.trmn.sh/tools/spaceship-prompt

## Install

- Homebrew: `brew install spaceship`
- npm: `npm install -g spaceship-prompt`
- AUR (yay): `yay -S spaceship-prompt`

## Overview

Spaceship is a prompt theme for Zsh (v5.2 or newer). It replaces the default prompt with one that displays contextual information next to the command line. It is built from "sections", each of which shows one piece of information and can be configured individually.

Documented sections include hostname and username, repository status (Git and Mercurial), runtime environment versions for languages such as Node.js, Rust, Python, Ruby, Swift, Go and PHP, Docker version, Kubernetes context, connected machine, package version (npm, lerna, cargo, composer and others), battery level and status, and an indicator for background jobs. Users can also write their own sections to show custom information, and the docs describe per-directory configuration.

It needs a Powerline or Nerd Font in the terminal. Installation is supported through Homebrew, npm, the AUR, and Zsh frameworks and plugin managers such as Oh-My-Zsh, prezto, zim, antigen, antibody, zinit, zgen, zplug and sheldon, or by cloning the repo and sourcing `spaceship.zsh` manually. It is aimed at Zsh users who want a configurable prompt that shows project and environment context, and it can be used alongside plugins such as zsh-autosuggestions and zsh-syntax-highlighting.

### Installation

```bash
# via Homebrew
brew install spaceship
```

```bash
# via npm
npm install -g spaceship-prompt
```

```bash
# via AUR (yay)
yay -S spaceship-prompt
```

![Spaceship with One Dark, zsh-autosuggestions and zsh-syntax-highlight](https://media.trmn.sh/cached/c3aa70fa61cdbed824076e9d8cafba4253f951a05d3a4f96a9b04b87bcfeb395.gif)

## Alternatives

- [tpm](https://www.trmn.sh/tools/tpm.md): Tmux Plugin Manager: installs, updates, and removes tmux plugins from GitHub or other git repositories, configured via ~/.tmux.conf. (Shell, 15.1k stars)
- [Pure](https://www.trmn.sh/tools/pure.md): ZSH prompt that shows git branch, dirty state, and async-checked unpushed/unpulled arrows, with exit-status coloring and command execution time. (Shell, 14.5k stars)
- [zsh-autosuggestions](https://www.trmn.sh/tools/zsh-autosuggestions.md): Zsh plugin that shows inline command suggestions after the cursor, drawn from history and tab-completion, in the style of Fish. (Shell, 36.2k stars)
- [Powerlevel10k](https://www.trmn.sh/tools/powerlevel10k.md): Zsh prompt theme with an interactive configuration wizard, instant prompt at shell startup, Git status segments, and Powerlevel9k config compatibility. (Shell, 55.3k stars)
- [Oh My Zsh](https://www.trmn.sh/tools/ohmyzsh.md): Community-maintained framework for managing zsh configuration, with 300+ plugins, 140+ themes, and a built-in updater. (Shell, 190.2k stars)

## Guides

- [Best Shell Prompts](https://www.trmn.sh/best/shell-prompts): Compare starship, Spaceship Prompt, Pure: workflows, strengths and tradeoffs.

---

Canonical: https://www.trmn.sh/tools/spaceship-prompt
