Starship Prompt Builder

Git metrics module

Will show the number of added and deleted lines in the current git repository

When it appears

This module is disabled by default. Enable it, then it renders when Starship detects the matching context.

Preview

Rendered from the starting configuration in a representative simulated environment.

starship — preview
+12 -3 

Starting configuration

[git_metrics]
disabled = false
format = "([+$added]($added_style) )([-$deleted]($deleted_style) )"
Open in the builder

The configuration is compressed into the URL fragment and stays in your browser.

Key options

added_stylestring
The style for the added count.
deleted_stylestring
The style for the deleted count.
only_nonzero_diffsboolean
Render status only for changed items.
formatstring
The format for the module.
disabledboolean
Disables the git_metrics module.
ignore_submodulesboolean
Ignore changes to submodules

Format variables

$added
The current number of added lines
$added_style
Mirrors the value of option added_style
$deleted
The current number of deleted lines
$deleted_style
Mirrors the value of option deleted_style

Common adjustments

  • Edit format to reorder its variables or make surrounding text conditional.
  • Adjust its style options to fit the palette used by the rest of the prompt.