Starship Prompt Builder

Google Cloud module

Shows the current configuration for gcloud CLI

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
on ☁️  [email protected](australia-southeast1) 

Starting configuration

[gcloud]
format = "on [$symbol$account(@$domain)(\\($region\\))]($style) "
symbol = "☁️  "
style = "bold blue"
Open in the builder

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

Key options

formatstring
The format for the module.
symbolstring
The symbol used before displaying the current GCP profile.
stylestring
The style for the module.
disabledboolean
Disables the gcloud module.
region_aliasesobject
Table of region aliases to display in addition to the GCP name.
project_aliasesobject
Table of project aliases to display in addition to the GCP name.
detect_env_varsarray
Which environmental variables should trigger this module

Format variables

$account
The current GCP profile
$active
The active config name written in ~/.config/gcloud/active_config
$domain
The current GCP profile domain
$project
The current GCP project
$region
The current GCP region
$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.