LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gcloud-config

gcloud CLI configuration management

TLDR

Set the default project
$ gcloud config set project [project-id]
copy
Set the default Compute Engine region and zone
$ gcloud config set compute/region [us-central1] && gcloud config set compute/zone [us-central1-a]
copy
Get the value of a property
$ gcloud config get-value [project]
copy
Unset a property
$ gcloud config unset [compute/zone]
copy
List all properties in the active configuration
$ gcloud config list
copy
Create a new named configuration
$ gcloud config configurations create [name]
copy
Activate a named configuration
$ gcloud config configurations activate [name]
copy
List all configurations
$ gcloud config configurations list
copy

SYNOPSIS

gcloud config command [options]

DESCRIPTION

gcloud config manages persistent configuration properties for the gcloud command-line tool. Properties set through this command become defaults used by all gcloud commands unless explicitly overridden with command-line flags.Common properties include the default project, Compute Engine region and zone, and active account. These eliminate the need to specify frequently-used values on every command, significantly reducing command verbosity for regular workflows.Named configurations enable managing multiple independent sets of properties, making it easy to switch between different projects, accounts, or environments. Each configuration is a complete set of property values that can be activated with a single command. This is essential for developers working across multiple GCP projects or organizations, as it prevents accidentally running commands in the wrong project context.

PARAMETERS

set SECTION/PROPERTY VALUE

Set a configuration property to a given value.
get-value SECTION/PROPERTY
Print the value of a property.
unset SECTION/PROPERTY
Remove a property from the active configuration.
list
List all properties in the active configuration.
configurations create NAME
Create a new named configuration.
configurations activate NAME
Switch to a named configuration.
configurations delete NAME
Delete a named configuration. Cannot delete the active configuration.
configurations describe NAME
Display details of a named configuration.
configurations list
List all available configurations.
--help
Display help information.

CAVEATS

Per-command options override config. Configuration is user-specific. Some properties require valid values. The active configuration cannot be deleted.

HISTORY

gcloud config is part of the Google Cloud SDK configuration system, providing persistent settings management for the CLI.

SEE ALSO

Copied to clipboard
Kai