Open-Source Wikis

/

Starship

/

Modules

/

Cloud and infrastructure modules

starship/starship

Cloud and infrastructure modules

Modules that show the state of cloud-vendor configurations, container orchestration tools, infrastructure-as-code tools, and related developer infra.

Modules

Module Default symbol What it shows Source
aws ☁️ Current AWS profile + region, expiration timer for temporary credentials src/modules/aws.rs
azure 󰠅 Current Azure subscription src/modules/azure.rs
gcloud ☁️ Active gcloud account, project, region src/modules/gcloud.rs
openstack ☁️ Current OpenStack cloud and project src/modules/openstack.rs
kubernetes Current kube context and namespace, with alias rules src/modules/kubernetes.rs
docker_context 🐳 Active Docker / Docker Desktop context src/modules/docker_context.rs
terraform 💠 Active Terraform workspace and version src/modules/terraform.rs
pulumi Pulumi user, stack, version src/modules/pulumi.rs
helm Helm CLI version src/modules/helm.rs
nats ✉️ Current NATS context src/modules/nats.rs
singularity 📦 Active Singularity image src/modules/singularity.rs
container Container indicator (LXC, Podman, systemd-nspawn, …) src/modules/container.rs
netns 🌐 Current Linux network namespace src/modules/netns.rs

Notable patterns

AWS

The aws module is the largest module in this group (~1.3K lines). It supports:

  • AWS native config — reads ~/.aws/config and ~/.aws/credentials (or paths from AWS_CONFIG_FILE / AWS_SHARED_CREDENTIALS_FILE) using the ini crate.
  • aws-vault — reads profile from AWS_VAULT and expiration from AWS_SESSION_EXPIRATION / AWS_CREDENTIAL_EXPIRATION.
  • awsu — reads profile from AWSU_PROFILE.
  • AWSume — reads profile from AWSUME_PROFILE and expiration from AWSUME_EXPIRATION.
  • aws-sso-cli — reads profile from AWS_SSO_PROFILE.

The expiration timer uses chrono::DateTime and is rendered through crate::utils::render_time. Region/profile aliases let the user replace long names like us-east-1 with short ones like va.

Kubernetes

kubernetes parses ~/.kube/config (or files listed in KUBECONFIG) using yaml-rust2, falls back to serde_json for JSON kubeconfigs, and exposes:

  • current-context name
  • mapped namespace, user, and cluster (per the user's TOML alias rules)

It supports per-context aliases with regex match patterns:

[kubernetes.context_aliases]
"dev.large/openshift/.*-cluster/.*" = "dev"
".*/openshift-cluster/.*" = "openshift"

The matching regex is anchored automatically. The module has a long-standing TODO about deprecated alias keys to be removed in starship 2.0.

gcloud

gcloud reads ~/.config/gcloud/active_config plus the named config file (config_<name>). It supports user/region/project aliases and detection rules.

Common configuration

All cloud modules support:

  • disabled = true (off by default for some, on for others; see PROMPT_ORDER)
  • format and style
  • symbol
  • detection knobs (file/folder presence, env-var presence) for those that need to scope to a project
  • a list of fallback commands for binaries that may have multiple installation paths

Failure modes

These modules deliberately fail silently:

  • Any unparseable config file is reported via log::warn! and the module returns None.
  • Network calls are not made; everything is read from local files or env vars.
  • Command timeouts are bounded by command_timeout (default 500ms), set in StarshipRootConfig.

Entry points for modification

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Cloud and infrastructure modules – Starship wiki | Factory