Skip to content

Instantly share code, notes, and snippets.

@azmarifdev
Last active June 16, 2025 06:07
Show Gist options
  • Save azmarifdev/b74f508c07d0af6f4edbbb6e480b53c1 to your computer and use it in GitHub Desktop.
Save azmarifdev/b74f508c07d0af6f4edbbb6e480b53c1 to your computer and use it in GitHub Desktop.
Starship Advance Config Docs

Starship

CROSS-SHELL-PROMPT

App Screenshot

The minimal, blazing-fast, and infinitely customizable prompt for any shell!

  • Fast: it's fast โ€“ really really fast! ๐Ÿš€
  • Customizable: configure every aspect of your prompt.
  • Universal: works on any shell, on any operating system.
  • Intelligent: shows relevant information at a glance.
  • Feature-rich: support for all your favorite tools.
  • Easy: quick to install โ€“ start using it in minutes.

๐Ÿš€ Installation

Prerequisites

Step 1. Install Starship

Select your operating system from the list below to view installation instructions:

  • Linux:

First, install curl:

  • Ubuntu/Mint:
sudo apt install curl
  • Fedora:
sudo dnf install curl
  • Manjaro/Arch:
sudo pacman -S curl

Then Install the latest version for your system:

curl -sS https://starship.rs/install.sh | sh

Alternatively, install Starship using any of the following package managers:

Distribution Instructions
Any cargo install starship --locked
Any conda install -c conda-forge starship
Any brew install starship
Alpine Linux 3.13+ apk add starship
Arch Linux pacman -S starship
CentOS 7+ dnf copr enable atim/starship dnf install starship
Gentoo emerge app-shells/starship
Manjaro pacman -S starship
NixOS nix-env -iA nixpkgs.starship
openSUSE zypper in starship
Void Linux xbps-install -S starship
  • MacOS

Install the latest version for your system:

curl -sS https://starship.rs/install.sh | sh
  • Windows

Install the latest version for your system with the MSI-installers from the releases section.

Install Starship using any of the following package managers:

Repository Instructions
crates.io cargo install starship --locked
Chocolatey choco install starship
conda-forge conda install -c conda-forge starship
Scoop scoop install starship
winget winget install --id Starship.Starship

Step 2. Set up your shell to use Starship

Configure your shell to initialize starship. Select yours from the list below:

  • Bash

Add the following to the end of ~/.bashrc:

eval "$(starship init bash)"
  • Cmd

You need to use Clink (v1.2.30+) with Cmd. Create a file at this path %LocalAppData%\clink\starship.lua with the following contents:

load(io.popen('starship init cmd'):read("*a"))()
  • Fish

Add the following to the end of ~/.config/fish/config.fish:

starship init fish | source
  • Nushell

Add the following to the end of your Nushell env file (find it by running $nu.env-path in Nushell):

mkdir ~/.cache/starship
starship init nu | save -f ~/.cache/starship/init.nu

And add the following to the end of your Nushell configuration (find it by running $nu.config-path ):

use ~/.cache/starship/init.nu
  • PowerShell

Add the following to the end of your PowerShell configuration (find it by running $PROFILE ):

Invoke-Expression (&starship init powershell)
  • Zsh

Add the following to the end of ~/.zshrc:

eval "$(starship init zsh)" 

Step 3. Configure Starship

Start a new shell instance, and you should see your beautiful new shell prompt. If you're happy with the defaults, enjoy!

If you're looking to further customize Starship:

You can use my advanced config file

To get started configuring starship, create the following file: ~/.config/starship.toml.

~/.config && touch ~/.config/starship.toml && sudo nano starship.toml

Then copy all config lines and paste in starship.toml file then save it.

# ==========================================================
# ๐ŸŒŸ Custom Starship Prompt Configuration by A. Z. M. Arif ๐ŸŒŸ
# ๐Ÿ”ง Crafted with care, full of tweaks, emojis & style!
# ๐Ÿ“ GitHub / Portfolio: azmarif.dev | Google me: azmarifdev
# ==========================================================

# ~/.config/starship.toml

add_newline = true


format = """\
$hostname $directory$git_branch$git_commit$git_state$git_status$git_metrics
$character\
"""

# Uncomment the modules you need in right_format.
# Keep others commented as reference for future use.

# right_format = """\
# $username
# $localip\
# $shlvl\
# $singularity\
# $kubernetes\
# $directory\
# $vcsh\
# $fossil_branch\
# $fossil_metrics\
# $hg_branch\
# $pijul_channel\
# $docker_context\
# $package\
# $c\
# $cmake\
# $cobol\
# $daml\
# $dart\
# $deno\
# $dotnet\
# $elixir\
# $elm\
# $erlang\
# $fennel\
# $gleam\
# $golang\
# $guix_shell\
# $haskell\
# $haxe\
# $helm\
# $java\
# $julia\
# $kotlin\
# $gradle\
# $lua\
# $nim\
# $nodejs\
# $ocaml\
# $opa\
# $perl\
# $php\
# $pulumi\
# $purescript\
# $python\
# $quarto\
# $raku\
# $rlang\
# $red\
# $ruby\
# $rust\
# $scala\
# $solidity\
# $swift\
# $terraform\
# $typst\
# $vlang\
# $vagrant\
# $zig\
# $buf\
# $nix_shell\
# $conda\
# $meson\
# $spack\
# $memory_usage\
# $aws\
# $gcloud\
# $openstack\
# $azure\
# $nats\
# $direnv\
# $env_var\
# $mise\
# $crystal\
# $custom\
# $sudo\
# $cmd_duration\
# $line_break\
# $jobs\
# $battery\
# $status\
# $os\
# $container\
# $netns\
# $shell\
# $time\
# """

continuation_prompt = 'โ–ถโ–ถ '

[character]
success_symbol = "[โžŸ](bold blue) "
error_symbol = "[โœ—](bold red) "

[username]
disabled = false

[hostname]
ssh_only = false
format = "[$hostname](bold #ee00ff) [โฏ](bold green)"
trim_at = ".companyname.com"
disabled = false

[directory]
truncation_length = 5
truncate_to_repo = true
read_only = " ๐Ÿ”’"
read_only_style = "red"
style = "bold italic blue"
format = "[$path]($style)[$read_only]($read_only_style) "

[cmd_duration]
min_time = 0
show_milliseconds = false
disabled = false
format = "[๏‰” $duration](bold yellow)"
style = "bold italic blue"

[docker_context]
format = "[$context](blue bold)"
symbol = '๏Œˆ '

[kubernetes]
format = 'on [โ˜ธ $context \($namespace\)](dimmed green) '
style = "bold bright-cyan"
symbol = "๏„ "
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"

[git_branch]
symbol = "๏˜ "
format = " [ ๎‚  $branch](fg:#9198a1)"
truncation_length = 15
truncation_symbol = ""

[git_commit]
commit_hash_length = 4
tag_symbol = " ๏ฐ– "

[git_state]
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[โฏโฏ PICKING](bold red)"

[git_status]
conflicted = '$ {count}โš  '
ahead = 'โ‡ก${count}'
behind = 'โ‡ฃ${count}'
diverged = 'โ‡•โ‡ก${ahead_count}โ‡ฃ${behind_count}'
untracked = ' ${count}ใ€ฅ '
stashed = ' ${count}โœ‚ '
modified = ' ${count}โœŽ '
staged = ' ${count}โšฃ '
renamed = ' ${count}โœ‘ '
deleted = ' ${count}โœ˜ '
format = '[[(๎ช„ $all_status$ahead_behind )](fg:#769ff0)]($style)'
style = "bg:#394260"

[time]
disabled = false
format = '[[ ๏บ $time ](fg:#a0a9cb )]($style)'
time_format = "%R"

[memory_usage]
symbol = "๏กš "
style = "bold bright-cyan"
format = " mem [${ram}( ${swap})]($style)"

[aws]
disabled = false
symbol = "๎Œฝ "
format = " [aws](italic) [$symbol $profile $region]($style)"
style = "bold blue"

[azure]
symbol = "๎ฏ˜ "
format = " [azure](italic) [$symbol]($style)"
style = "bold bright-yellow"

[gcloud]
symbol = "gcloud "
format = " [gcloud](italic) [$symbol]($style)"
style = "bold bright-cyan"

# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Language / Runtime Support โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

[nodejs]
format = "[๎œ˜ $version](bold green) "
detect_files = ["package.json", ".node-version", "package-lock.json", "yarn.lock"]
detect_folders = ["node_modules"]

[python]
symbol = "[๎ด› ](bold bright-blue)"
format = "[๎ด› ($virtualenv) $version](bold bright-yellow)"
version_format = "${raw}"

[rust]
symbol = "๎š‹ "
format = " rs(italic) $symbol($style)"
style = "bold bright-red"

[golang]
format = "[๎˜ง $version](bold cyan)"

[dart]
symbol = "๎ž˜ "
format = " dart [$symbol]($style)"
style = "bold bright-cyan"

[lua]
format = "[๎˜  $version](bold blue)"

[php]
symbol = "๎˜ˆ "
format = " [php](italic) [$symbol]($style)"
style = "bold bright-red"

[ruby]
symbol = "๎˜… "
format = " [rb](italic) [$symbol]($style)"
style = "bold red"

[swift]
symbol = "๎š™ "
format = " [sw](italic) [$symbol]($style)"
style = "bold bright-red"

[cpp]
symbol = "๎™† "
format = " [cpp](italic) [$symbol]($style)"
style = "bold bright-cyan"

[conda]
symbol = "โ—ฏ "
format = " conda [$symbol$environment]($style)"
style = "bold bright-red"

[helm]
format = "[โŽˆ $version](bold white)"

[elixir]
symbol = "๎‰ต "
format = " exs [$symbol OTP $otp_version ]($style)"
style = "bold bright-yellow"

[haskell]
symbol = "ฮป "
format = " [ฮป $version](bold bright-magenta)"

[java]
symbol = "๎‰– "
format = " [โ˜• $version](bold red)"

[julia]
symbol = "เฎƒ "
format = " [เฎƒ $version](bold bright-purple)"

[kotlin]
symbol = "๐Ÿ…บ "
format = " [๐Ÿ…บ $version](bold blue)"

[perl]
symbol = "๐Ÿช "
format = " [pl $version](bold bright-cyan)"

[scala]
symbol = "๎œท "
format = " [๎œท $version](bold red)"

[terraform]
symbol = "๓ฑข "
format = " [๓ฑข $version](bold magenta)"

[crystal]
symbol = "๐Ÿ”ฎ "
format = " [๐Ÿ”ฎ $version](bold cyan)"

[ocaml]
symbol = "๐Ÿซ "
format = " [๐Ÿซ $version](bold yellow)"

[zig]
symbol = "โšก "
format = " [โšก Zig $version](bold yellow)"

[vlang]
symbol = "๐Ÿ”น "
format = " [V $version](bold cyan)"

[deno]
symbol = "๐Ÿฆ• "
format = " [๐Ÿฆ• Deno $version](bold green)"

[cmake]
format = " [๐Ÿ›  CMake $version](bold cyan)"

[gradle]
symbol = "๐Ÿงฑ "
format = " [๐Ÿงฑ Gradle $version](bold purple)"

[meson]
format = " [๐Ÿ— Meson $version](bold bright-blue)"

[guix_shell]
symbol = "โ™ป๏ธ "
format = " [guix: $name](bold green)"

# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Platform/Infra/Utility Modules โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

[nix_shell]
symbol = "โ„๏ธ "
format = " [โ„๏ธ nix: $name](bold blue)"
impure_msg = "impure"
pure_msg = "pure"
unknown_msg = "unknown"
style = "bold bright-blue"
disabled = false

[container]
symbol = "๐Ÿ“ฆ "
format = " [๐Ÿ“ฆ container: $name](bold red)"
style = "bold red"
disabled = false

[pulumi]
symbol = "๏†ฒ "
format = " [๏†ฒ Pulumi $username](bold magenta)"
style = "bold bright-magenta"
disabled = false

[vagrant]
symbol = "๐Ÿ“ฆ "
format = " [๐Ÿ“ฆ Vagrant $version](bold bright-yellow)"
disabled = false

# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ System Info Modules โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

[battery]
full_symbol = "๐Ÿ”‹"
charging_symbol = "โšก๏ธ"
discharging_symbol = "๐Ÿ”Œ"
format = " [$symbol $percentage]($style) "
style = "bold green"
disabled = false

[shell]
format = " [๎ž• $indicator]($style)"
style = "bold purple"
disabled = false

[sudo]
format = " [๏‘„ as root](bold red)"
style = "bold red"
disabled = false

[os]
format = " [๏Œƒ $name](bold white)"
style = "bold bright-blue"
disabled = false

[status]
format = ' [โœ˜ $status](bold red)'
disabled = false

[jobs]
symbol = "โœฆ "
format = " [$symbol$number]($style)"
style = "bold bright-green"
disabled = false

# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Miscellaneous โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

[env_var]
variable = "CUSTOM_ENV"
format = " [$env_value](bold blue)"

[package]
symbol = 'โœ‡ '


# You can continue adding more languages like Haskell, Nim, Kotlin, etc. from the second config if needed

Follow this shortcut if you don't know how to save and exit the nano file.

(Press Ctrl + O then Press Enter to Save And Press Ctrl + X to Exit)

Official Documents

  • Starship Docs
  • Configuration โ€“ learn how to configure Starship to tweak your prompt to your liking
  • Presets โ€“ get inspired by the pre-built configuration of others

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment