Skip to content
Latchkey

gcloud info: Diagnose the SDK Environment

gcloud info reports the SDK environment: active account and project, config and log paths, and installed components.

When a pipeline authenticates but commands still fail, gcloud info is the first diagnostic. It shows exactly which account and project gcloud thinks are active.

What it does

gcloud info prints a snapshot of the environment: the active account and project, the configuration directory, log file locations, Python version, and installed components. --run-diagnostics adds network and property checks.

Common usage

Terminal
gcloud info
# extract just the active account and project
gcloud info --format='value(config.account, config.project)'
# run connectivity and property checks
gcloud info --run-diagnostics

Flags

FlagWhat it does
--run-diagnosticsRun network and property diagnostic checks
--format <fmt>Extract specific fields, e.g. value(config.account)
--anonymizeRedact personal info for sharing in bug reports

In CI

Run gcloud info early in a job to confirm Workload Identity Federation actually set the expected account and project before the real commands run; it turns a silent misconfiguration into an explicit, readable log line. Use --anonymize before pasting output into a public issue.

Common errors in CI

If the "Account" line is empty, the auth step did not take effect, so fix authentication before anything else. A "Project" of None means core/project is unset; set it with gcloud config set project. --run-diagnostics reporting a network reachability failure points at a proxy or firewall blocking *.googleapis.com.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →