gcloud-config-set
Set Google Cloud SDK configuration properties
TLDR
Set the project property in the core section
Set the compute zone for future operations
Disable prompting to make gcloud suitable for scripting
View the list of properties currently in use
Unset a previously set property
Create a new configuration profile
Switch between different configuration profiles
SYNOPSIS
gcloud config set PROPERTY VALUE [--scope=SCOPE] [--installation] [--format=FORMAT] [--help]
PARAMETERS
PROPERTY
Property name in [SECTION/]KEY format, e.g., project/my-project-id or compute/zone/us-central1-a
VALUE
Value to assign to the property
--scope=SCOPE
Scope: user (default, overrides installation) or installation (global)
--installation, -i
Equivalent to --scope=installation; store in installation scope
--format=FORMAT
Output format (e.g., json, table)
--help
Show detailed help
DESCRIPTION
The gcloud config set command updates properties in the Google Cloud CLI configuration, which controls default settings like project ID, compute zone, or authentication paths. Properties follow a [SECTION/]KEY format, such as project/my-project or compute/zone/us-central1-a. Changes apply to the active configuration (view with gcloud config configurations list). By default, values are stored in user scope, overriding installation defaults. Use for quick setup in scripts or interactive sessions.
This enables environment-specific configs without flags on every command, streamlining workflows for Cloud projects. Common uses include setting billing projects, default regions, or metric scopes. Always verify with gcloud config list post-change.
CAVEATS
Changes affect only the active configuration; use gcloud config configurations activate to switch. Installation scope requires admin rights and impacts all users.
EXAMPLES
gcloud config set project my-project-id
gcloud config set compute/zone us-central1-a
gcloud config set --scope=installation metrics/environment prod
SCOPES
user: Per-user, highest precedence.
installation: System-wide, lowest precedence.
HISTORY
Introduced with Google Cloud SDK v0.1 in 2013; evolved with gcloud CLI unification in SDK 130.0.0 (2017) for better config management.
SEE ALSO
gcloud config get(1), gcloud config list(1), gcloud config configurations(1)


