This page contains an overview of the gcloud command-line tool.
What is gcloud?
gcloud is a tool that provides the primary command-line interface to
Google Cloud Platform. You can use this tool to perform many common platform
tasks either from the command-line, or in scripts and other automations.
For example, you can use gcloud to create and manage:
- Google Compute Engine virtual machine instances and other resources
- Google Cloud SQL instances
- Google Container Engine clusters
- Google Cloud Dataproc clusters and jobs
- Google Cloud DNS managed zones and record sets
- Google Cloud Deployment manager deployments
You can also use gcloud to deploy App Engine applications and perform other
tasks. Read the gcloud Reference to learn more about
the capabilities of the tool.
gcloud and the SDK
gcloud is a part of the Google Cloud SDK. You must
download and install the SDK on your system and
initialize it before you can use gcloud.
By default, the SDK installs those gcloud commands that are at the General
Availability and Preview levels only. Additional functionality is
available in SDK components named
alpha and beta. These components allow you to use gcloud to work with
Google Cloud Bigtable, Google Cloud Dataflow and other parts of the Cloud
Platform at earlier release levels than General Availability.
gcloud releases have the same version number as the SDK. The current SDK
version is 162.0.1. You can download and install
previous versions of the SDK from the
download archive.
Downloading gcloud
You can download the latest version of Cloud SDK, which includes gcloud, from
the download page.
Release levels
gcloud commands have the following release levels:
| Release level | Label | Description |
|---|---|---|
| General Availability | None | Commands are considered fully stable and available for production use. Any commands that break current functionality are subject to a formal deprecation policy and are documented in the release notes. |
| Beta | beta |
Commands are functionally complete, but may still have some outstanding issues. Not covered by any service-level agreement (SLA). |
| Alpha | alpha |
Commands are in early release and may change without notice. Not covered by any SLA. |
| Preview | preview |
Commands may be unstable and may change without notice. Not covered by any SLA. |
The alpha and beta components are not installed by default when you install
the SDK. You must install these
separately using the gcloud components install command. If you try to run a
Alpha or Beta command and the corresponding component is not installed,
gcloud prompts you to install it.
Command groups
Within each release level, gcloud commands are organized into a nested
hierarchy of command groups, each of which represents a product or feature of
the Cloud Platform or its functional subgroups.
For example:
| Command group | Description |
|---|---|
gcloud compute |
Commands related to Compute Engine in general availability |
gcloud compute instances |
Commands related to Compute Engine instances in general availability |
gcloud beta compute |
Commands related to Compute Engine in Beta |
gcloud preview app |
Commands related to App Engine in Preview |
Properties
The SDK has a set of properties that govern the
behavior of the gcloud command-line tool and other SDK tools. You can use
these properties to control the behavior of gcloud commands across invocations.
Configurations
Configurations are named sets of properties.
gcloud automatically provides a configuration named default and uses
it as the initial active configuration. This single default configuration is
suitable for many use cases. However, you can also create additional
configurations and switch between them as required.
Global flags
gcloud provides a set of global flags that govern
the behavior of commands on a per-invocation level. Flags override any
values set in SDK properties.
Output formatting
The --format global flag changes the
default output for gcloud commands. Supported formats include json, yaml,
value and csv for scripting, and table and flattened for interactive
display.
Running gcloud commands
You can run gcloud commands from the command line in the same way you use
other command-line tools. You can also run gcloud commands from within
scripts and other automations,
for example, when using Jenkins to automate Cloud Platform tasks.
What's next
- Learn more about
gcloudcommands in the gcloud Reference.