Starship Prompt Builder

Docker context module

Shows the active Docker context when it is not the default

When it appears

It renders when Starship detects the matching context and its configured conditions are met.

Preview

Rendered from the starting configuration in a representative simulated environment.

starship — preview
via 🐳 desktop 

Starting configuration

[docker_context]
format = "via [$symbol$context]($style) "
symbol = "🐳 "
style = "blue bold"
Open in the builder

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

Key options

symbolstring
The symbol used before displaying the Docker context.
stylestring
The style for the module.
formatstring
The format for the module.
only_with_filesboolean
Only show when there's a match
disabledboolean
Disables the docker_context module.
detect_extensionsarray
Which extensions should trigger this module (needs only_with_files to be true).
detect_filesarray
Which filenames should trigger this module (needs only_with_files to be true).
detect_foldersarray
Which folders should trigger this module (needs only_with_files to be true).

Format variables

$context
The current docker context
$style
Mirrors the value of option style
$symbol
Mirrors the value of option symbol

Common adjustments

  • Tune the detection options if this module appears in the wrong projects or misses the right ones.
  • 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.