gcloud versionDisplays the installed Google Cloud SDK version and component information.
The gcloud CLI for Google Cloud: manage projects, IAM, Compute Engine, GKE and storage from the terminal.
brew install --cask google-cloud-sdkgcloud versionDisplays the installed Google Cloud SDK version and component information.
gcloud components listLists all available SDK components and their current installation status.
gcloud components updateUpdates all installed SDK components to the latest available version.
gcloud helpDisplays detailed help documentation for a specific command group or subcommand.
Example
gcloud help compute instances creategcloud auth loginInitiates the browser-based authentication flow to log in with a user account.
gcloud auth listLists all credentialed accounts currently active in the gcloud environment.
gcloud auth application-default loginAcquires credentials for Application Default Credentials (ADC) used by client libraries.
gcloud auth revokeRevokes credentials for a specific account, logging them out of the CLI.
Example
gcloud auth revoke user@example.comgcloud config listDisplays the active configuration properties for the current environment.
gcloud config set projectSets the default project ID for subsequent commands to target.
Example
gcloud config set project my-project-idgcloud config configurations createCreates a new named configuration profile to isolate settings between environments.
Example
gcloud config configurations create my-lab-configgcloud config configurations activateSwitches the active CLI context to a specific named configuration.
Example
gcloud config configurations activate my-lab-configgcloud projects listLists all Google Cloud projects visible to the currently authenticated user.
gcloud projects describeShows metadata and lifecycle state for a specific project.
Example
gcloud projects describe my-project-idgcloud projects createCreates a new Google Cloud project with the specified ID and display name.
Example
gcloud projects create my-new-project-id --name='My New Project'gcloud iam roles listLists the standard curated IAM roles available in the project.
gcloud iam service-accounts listLists all service accounts residing within the current project.
gcloud iam service-accounts createCreates a new service account within the current project.
Example
gcloud iam service-accounts create my-sa --display-name='My Service Account'gcloud projects get-iam-policyRetrieves the IAM policy (permissions bindings) attached to the specified project.
Example
gcloud projects get-iam-policy my-project-idgcloud projects add-iam-policy-bindingAdds an IAM policy binding to grant a specific role to a user or principal.
Example
gcloud projects add-iam-policy-binding my-project-id --member='user:alice@example.com' --role='roles/viewer'gcloud compute zones listLists all available Compute Engine zones and their status.
gcloud compute instances listLists all virtual machine instances in the project across all zones.
gcloud compute instances describeDisplays detailed configuration and status of a specific VM instance.
Example
gcloud compute instances describe my-instance --zone=us-central1-agcloud compute instances createCreates and starts a new VM instance with specified parameters.
Example
gcloud compute instances create my-vm --zone=us-central1-a --machine-type=e2-microgcloud compute instances startStarts a currently stopped virtual machine instance.
Example
gcloud compute instances start my-vm --zone=us-central1-agcloud compute instances stopStops a running virtual machine instance.
Example
gcloud compute instances stop my-vm --zone=us-central1-agcloud compute sshEstablishes an SSH connection to the instance using automatically managed keys.
Example
gcloud compute ssh my-vm --zone=us-central1-agcloud compute networks listLists all VPC networks defined in the project.
gcloud compute networks subnets listLists all subnets associated with VPC networks in the project.
gcloud compute firewall-rules listLists all firewall rules configured for the project's networks.
gcloud compute firewall-rules describeShows detailed configuration of a specific firewall rule.
Example
gcloud compute firewall-rules describe allow-sshgcloud compute firewall-rules createCreates a new firewall rule allowing incoming TCP traffic on port 80.
Example
gcloud compute firewall-rules create allow-http --allow tcp:80 --network defaultgcloud storage lsLists all Cloud Storage buckets in the project.
gcloud storage buckets createCreates a new Cloud Storage bucket.
Example
gcloud storage buckets create gs://my-unique-bucket-namegcloud storage buckets describeDisplays metadata and settings for a specific bucket.
Example
gcloud storage buckets describe gs://my-unique-bucket-namegcloud storage cpCopies a file from the local filesystem to a Cloud Storage bucket.
Example
gcloud storage cp local-file.txt gs://my-bucket/remote-file.txtgcloud functions listLists all Cloud Functions deployed in the project.
gcloud functions deployDirectly injects Python/Node code bridging it natively into GCP's ecosystem without requiring Dockerfile architectures.
Example
gcloud functions deploy log_parser --runtime python39 --trigger-topic system_logsgcloud sql instances listLists all Cloud SQL database instances.
gcloud iam service-accounts keys listLists the keys associated with a specific service account.
Example
gcloud iam service-accounts keys list --iam-account=sa@project.iam.gserviceaccount.comgcloud iam service-accounts keys createCreates and downloads a new JSON key file for a service account.
Example
gcloud iam service-accounts keys create key.json --iam-account=sa@project.iam.gserviceaccount.comgcloud iam roles describeShows the permissions included in a specific IAM role.
Example
gcloud iam roles describe roles/editorgcloud iam roles createCreates a custom IAM role with a defined set of permissions.
Example
gcloud iam roles create MyCustomRole --project=my-project --permissions=compute.instances.get,compute.instances.listgcloud iam workload-identity-pools listLists Workload Identity Pools for federated authentication.
Example
gcloud iam workload-identity-pools list --location=globalgcloud iam workload-identity-pools providers listLists identity providers configured within a Workload Identity Pool.
Example
gcloud iam workload-identity-pools providers list --workload-identity-pool=my-pool --location=globalgcloud services listLists all APIs and services that are currently enabled in the project.
Example
gcloud services list --enabledgcloud services enableEnables a specific Google Cloud API for the project.
Example
gcloud services enable cloudasset.googleapis.comgcloud asset search-all-resourcesSearches all resources in the project matching a specific query using Cloud Asset Inventory.
Example
gcloud asset search-all-resources --scope=projects/my-project --query='name:production'gcloud asset search-all-iam-policiesFinds all IAM policies in the project that grant the Owner role.
Example
gcloud asset search-all-iam-policies --scope=projects/my-project --query='policy:roles/owner'gcloud compute firewall-rules list --filter='sourceRanges:(0.0.0.0/0)'Identifies firewall rules that allow traffic from the entire internet.
gcloud compute instances list --filter='networkInterfaces.accessConfigs.natIP:*'Lists all VM instances that have an external public IP address assigned.
gcloud projects get-iam-policy my-project --flatten='bindings[].members' --filter='bindings.members:allUsers'Checks if any project-level IAM policies grant access to 'allUsers' (public access).
gcloud storage buckets list --format='value(name, public_access_prevention)'Lists buckets and checks their Public Access Prevention status.
gcloud logging sinks listLists log router sinks to verify where logs are being exported.
gcloud compute snapshots listLists compute disk snapshots created more than 30 days ago.
Example
gcloud compute snapshots list --filter='creationTimestamp < -P30D'gcloud compute disks listLists only disks that are currently attached to a VM instance.
Example
gcloud compute disks list --filter='users:*'gcloud compute disks list --filter='-users:*'Lists orphaned disks that are not attached to any VM instance.
gcloud builds listLists currently running Cloud Build operations.
Example
gcloud builds list --ongoinggcloud projects list --format='csv(projectId, projectNumber)'Exports a list of project IDs and numbers to a CSV format.
Example
gcloud projects list --format='csv(projectId, projectNumber)' > projects.csvgcloud iam service-accounts list --format='value(email)'Extracts and lists only the email addresses of service accounts.
gcloud resource-manager org-policies listLists organization policies currently applied to the project.
Example
gcloud resource-manager org-policies list --project=my-projectgcloud resource-manager org-policies describeDescribes the configuration of a specific organization policy constraint.
Example
gcloud resource-manager org-policies describe compute.disableSerialPortAccess --project=my-projectgcloud logging read 'protoPayload.methodName="beta.compute.firewalls.insert"' --limit=5Searches logs for recent firewall rule creation events.
gcloud logging read 'resource.type="gce_instance" AND protoPayload.methodName="v1.compute.instances.delete"'Searches logs for VM instance deletion events.
gcloud compute instances add-metadataTags a compromised instance with metadata to signal an active investigation.
Example
gcloud compute instances add-metadata my-compromised-vm --metadata=forensics-status=investigatinggcloud compute instances stop --asyncImmediately sends a stop signal to a VM without waiting for the operation to complete.
Example
gcloud compute instances stop my-compromised-vm --asyncgcloud compute firewall-rules updateDisables a specific firewall rule to immediately cut off access.
Example
gcloud compute firewall-rules update default-allow-ssh --disabledgcloud config set auth/impersonate_service_accountConfigures the CLI to impersonate a service account for all subsequent commands.
Example
gcloud config set auth/impersonate_service_account sa@project.iam.gserviceaccount.comgcloud config unset auth/impersonate_service_accountStops service account impersonation and reverts to the original user credentials.
gcloud compute instances list --impersonate-service-accountRuns a single command impersonating a service account without changing global config.
Example
gcloud compute instances list --impersonate-service-account=sa@project.iam.gserviceaccount.comgcloud alpha bq datasets listLists BigQuery datasets (note: usually done via 'bq' tool, but gcloud has alpha support).
gcloud deployment-manager deployments listLists infrastructure deployments managed by Cloud Deployment Manager.
gcloud config set compute/regionSets the default compute region to avoid specifying the flag in every command.
Example
gcloud config set compute/region us-central1gcloud config set compute/zoneSets the default compute zone to avoid specifying the flag in every command.
Example
gcloud config set compute/zone us-central1-agcloud config set core/disable_usage_reportingDisables the anonymous usage reporting sent to Google.
Example
gcloud config set core/disable_usage_reporting truegcloud compute networks peerings listLists VPC peerings connected to a specific network.
Example
gcloud compute networks peerings list --network=defaultgcloud compute interconnects listLists dedicated physical interconnect connections.
gcloud filestore instances listLists fully managed NFS file servers (Filestore instances).
gcloud redis instances listLists Memorystore for Redis instances.
Example
gcloud redis instances list --region=us-central1gcloud compute project-info describeDisplays project-wide metadata including default network tiers and usage export buckets.
gcloud compute shared-vpc get-host-projectChecks if the current project is attached to a Shared VPC Host project.
Example
gcloud compute shared-vpc get-host-project my-projectgcloud access-context-manager policies listLists VPC Service Controls access policies for an organization.
Example
gcloud access-context-manager policies list --organization=123456789gcloud access-context-manager perimeters listLists service perimeters defined in VPC Service Controls.
Example
gcloud access-context-manager perimeters list --policy=123456789gcloud compute os-login describe-profileDescribes the OS Login profile for the current user, used for SSH access management.
gcloud alpha scc assets listLists assets monitored by Security Command Center (SCC).
Example
gcloud alpha scc assets list --organization=123456789gcloud alpha scc findings listLists active security findings detected by Security Command Center.
Example
gcloud alpha scc findings list --organization=123456789 --filter='state="ACTIVE"'gcloud tasks queues listLists queues used for asynchronous task execution.
gcloud dataproc clusters listLists Hadoop/Spark clusters managed by Dataproc.
Example
gcloud dataproc clusters list --region=us-central1gcloud dataflow jobs listLists Dataflow streaming and batch jobs.
gcloud compute start-iap-tunnelStarts an IAP tunnel to forward a local port to the instance's SSH port.
Example
gcloud compute start-iap-tunnel my-instance 22 --zone=us-central1-agcloud storage buckets updateUpdates a bucket to enforce uniform bucket-level access (disabling object ACLs).
Example
gcloud storage buckets update gs://my-bucket --uniform-bucket-level-accessgcloud storage objects updateModifies object ACLs (caution: creates public objects).
Example
gcloud storage objects update gs://my-bucket/file.txt --add-acl-grant=entity=AllUsers,role=READERgcloud storage hmac listLists HMAC keys used for S3-interoperable storage access.
gcloud service-directory namespaces listLists namespaces in Service Directory.
gcloud recaptcha keys listLists reCAPTCHA Enterprise keys.
gcloud compute health-checks listLists health checks used by load balancers and managed instance groups.
gcloud compute instance-groups unmanaged listLists unmanaged instance groups (often used for legacy setups).
gcloud compute instances deleteDeletes a VM instance without interactive confirmation.
Example
gcloud compute instances delete my-vm --zone=us-central1-a --quietgcloud storage rmDeletes a specific object from a Cloud Storage bucket.
Example
gcloud storage rm gs://my-bucket/file.txtgcloud storage rm -rRecursively deletes a bucket and all objects contained within it.
Example
gcloud storage rm -r gs://my-bucketgcloud projects deleteShuts down a project and schedules it for deletion.
Example
gcloud projects delete my-project-idgcloud compute firewall-rules deleteDeletes a specific firewall rule.
Example
gcloud compute firewall-rules delete allow-httpgcloud container clusters deleteDeletes a GKE cluster and its associated resources.
Example
gcloud container clusters delete my-cluster --zone=us-central1-agcloud iam service-accounts deleteDeletes a service account identity.
Example
gcloud iam service-accounts delete my-sa@my-project.iam.gserviceaccount.comgcloud endpoints services listLists Cloud Endpoints services.
gcloud policy-intelligence troubleshootTroubleshoots why a principal has or lacks a specific permission on a resource.
Example
gcloud policy-intelligence troubleshoot --principal-email=user@example.com --permission=compute.instances.start --resource=//compute.googleapis.com/projects/my-proj/zones/us-central1-a/instances/my-vmgcloud alpha cloud-shell sshConnects to the interactive Cloud Shell environment via SSH.
gcloud feedbackSubmits feedback about the gcloud CLI to the Google team.
gcloud run deployInstantly compiles a standard Docker container straight into a fully load-balanced, auto-scaling web application.
Example
gcloud run deploy my-app --image gcr.io/my-proj/my-app --allow-unauthenticatedgcloud run services listMaps all live auto-scaling container configurations, resolving direct HTTPs public invocation endpoints.
Example
gcloud run services list --platform managedgcloud pubsub topics createEstablishes a highly decoupled message ingestion point capable of receiving millions of asynchronous API payloads.
Example
gcloud pubsub topics create my-notification-topicgcloud pubsub subscriptions pullManually interrogates a subscription queue, extracting pending messages natively and systematically acknowledging them via CLI.
Example
gcloud pubsub subscriptions pull my-sub --auto-ackgcloud spanner instances listInventories globally distributed strictly-consistent NoSQL relational nodes detailing structural allocation.
gcloud builds submitUploads the entire localized CWD to Google's build arrays, executing the Docker build remotely to circumvent local compute limitations.
Example
gcloud builds submit --tag gcr.io/my-proj/hello-world .gcloud iam service-accounts keys createExtracts absolute God-Mode local authentication architectures bypassing MFA to programmatically impersonate cloud environments.
Example
gcloud iam service-accounts keys create ./key.json --iam-account sa@proj.gserviceaccount.comgcloud artifacts docker tags addManipulates strictly-defined OCI metadata remapping canonical latest pointers onto explicitly secured hash versions.
Example
gcloud artifacts docker tags add us-east1-docker.pkg.dev/.../image:v1 .../image:latestAmazon’s official command line for AWS: manage IAM, S3, EC2, Lambda and every other service, and audit an account’s configuration.
Microsoft’s cross-platform CLI for Azure: manage subscriptions, Entra ID, VMs, storage and networking, and review security posture.
The Kubernetes command line: inspect and manage clusters, workloads, RBAC and secrets — and check what an identity is allowed to do.