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/configand~/.aws/credentials(or paths fromAWS_CONFIG_FILE/AWS_SHARED_CREDENTIALS_FILE) using theinicrate. aws-vault— reads profile fromAWS_VAULTand expiration fromAWS_SESSION_EXPIRATION/AWS_CREDENTIAL_EXPIRATION.awsu— reads profile fromAWSU_PROFILE.AWSume— reads profile fromAWSUME_PROFILEand expiration fromAWSUME_EXPIRATION.aws-sso-cli— reads profile fromAWS_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-contextname- 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; seePROMPT_ORDER)formatandstylesymbol- 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 returnsNone. - Network calls are not made; everything is read from local files or env vars.
- Command timeouts are bounded by
command_timeout(default 500ms), set inStarshipRootConfig.
Entry points for modification
- To support a new vendor of AWS-credential helper, extend the
get_profile/get_regionchains insrc/modules/aws.rs. - To add a new kube alias style, edit
get_aliased_nameinsrc/modules/kubernetes.rs. - For an entirely new infra module, follow Adding a new module.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.