Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Empêchez l'utilisation de couleurs lors de l'impression de messages sur le terminal en définissant une propriété principale :
gcloud config set disable_color true
Désactivez la propriété disable_color :
gcloud config unset disable_color
Si l'API Compute Engine est activée, définissez votre région Compute Engine préférée.
Remplacez REGION par le nom d'une région, par exemple us-east1 :
gcloudconfigsetcompute/regionREGION
Vous pouvez également définir la zone de votre choix.
Remplacez ZONE par le nom d'une zone, par exemple us-east1-b :
gcloud config set compute/zone ZONE
Pour en savoir plus sur les régions et les zones Compute Engine, consultez Régions et zones.
Affichez la liste des propriétés disponibles :
gcloud topic configurations
Exécuter les commandes de base
Répertoriez les comptes dont les identifiants sont stockés sur le système local :
gcloud auth list
Gcloud CLI affiche la liste des comptes identifiés, où ACCOUNT_EMAIL représente une liste d'un ou plusieurs comptes actifs :
Credentialed Accounts
ACTIVE ACCOUNT
\* ACCOUNT_EMAIL
Répertoriez les propriétés de votre configuration gcloud CLI active :
gcloud config list
La gcloud CLI affiche la liste des propriétés, qui ressemble à ce qui suit, où ACCOUNT_EMAIL et PROJECT_ID affichent votre adresse e-mail et votre ID de projet :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Quickstart: Run gcloud commands with Cloud Shell\n\nRun `gcloud` commands with Cloud Shell\n======================================\n\nLearn how to run gcloud CLI commands in Cloud Shell.\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nCloud Shell Editor, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/freetrial?redirectPath=/?walkthrough_id=sdk--cloud-cli-quickstart)\n\n*** ** * ** ***\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\nSet `gcloud` properties\n-----------------------\n\n1. [Launch the Cloud Shell Editor](https://ide.cloud.google.com).\n2. Prevent color from being used when printing messages to the terminal by\n setting a core property:\n\n gcloud config set disable_color true\n\n3. Unset the `disable_color` property:\n\n gcloud config unset disable_color\n\n4. If you have the Compute Engine API enabled, set your preferred\n Compute Engine region.\n Replace \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e with a region name---for example,\n `us-east1`:\n\n gcloud config set compute/region \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e\n\n Alternatively, you can set your preferred zone.\n Replace \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e with a zone name---for example,\n `us-east1-b`: \n\n gcloud config set compute/zone \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e\n\n For information about Compute Engine regions and zones, see\n [Regions and zones](/compute/docs/regions-zones).\n5. Display a list of available properties:\n\n gcloud topic configurations\n\nRun core commands\n-----------------\n\n1. List accounts whose credentials are stored on the local system:\n\n gcloud auth list\n\n The gcloud CLI displays a list of credentialed accounts,\n where \u003cvar translate=\"no\"\u003eACCOUNT_EMAIL\u003c/var\u003e represents a list of one or more\n active accounts: \n\n Credentialed Accounts\n ACTIVE ACCOUNT\n \\* \u003cvar translate=\"no\"\u003eACCOUNT_EMAIL\u003c/var\u003e\n\n2. List the properties in your active gcloud CLI configuration:\n\n gcloud config list\n\n The gcloud CLI displays the list of properties similar to the\n following, where \u003cvar translate=\"no\"\u003eACCOUNT_EMAIL\u003c/var\u003e and\n \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e display your email and project ID: \n\n ```\n [core]\n account = ACCOUNT_EMAIL\n disable_usage_reporting = False\n project = PROJECT_ID\n ```\n3. View information about your gcloud CLI installation and the\n active configuration:\n\n gcloud info\n\nView help for `gcloud` commands\n-------------------------------\n\n1. View the help for the `gcloud compute instances create` command:\n\n gcloud help compute instances create\n\n2. View available commands under `gcloud topic`:\n\n gcloud help topic\n\n3. View information on filtering:\n\n gcloud topic filters\n\n4. Learn more about `gcloud` command structure:\n\n gcloud topic command-conventions\n\nWhat's next\n-----------\n\n- Learn [how Cloud Shell works](/shell/docs/how-cloud-shell-works).\n- [Deploy a Cloud Run app by using Cloud Shell](/shell/docs/deploy-cloud-run-app)."]]