← 返回命令列表

Linux command

gcloud-init 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize gcloud

gcloud init

Initialize without browser

gcloud init --console-only

Reinitialize with new configuration

gcloud init --skip-diagnostics

说明

gcloud init is an interactive wizard that guides you through the initial setup of the Google Cloud SDK. It handles authentication by launching a browser for OAuth login, then helps you select a default project from those available to your account. The initialization process also prompts for default Compute Engine region and zone settings, which streamlines future commands by eliminating the need to specify these values repeatedly. The command creates or updates a configuration profile with these preferences. gcloud init can be run multiple times to create different named configurations for working with multiple projects or accounts. It's the recommended first step after installing the Google Cloud SDK and the easiest way to switch between different GCP environments.

参数

--console-only
Don't launch browser for login.
--skip-diagnostics
Skip network diagnostics.
--configuration _name_
Use specific configuration.

FAQ

What is the gcloud-init command used for?

gcloud init is an interactive wizard that guides you through the initial setup of the Google Cloud SDK. It handles authentication by launching a browser for OAuth login, then helps you select a default project from those available to your account. The initialization process also prompts for default Compute Engine region and zone settings, which streamlines future commands by eliminating the need to specify these values repeatedly. The command creates or updates a configuration profile with these preferences. gcloud init can be run multiple times to create different named configurations for working with multiple projects or accounts. It's the recommended first step after installing the Google Cloud SDK and the easiest way to switch between different GCP environments.

How do I run a basic gcloud-init example?

Run `gcloud init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --console-only do in gcloud-init?

Don't launch browser for login.