Ajouter le répertoire bin de la CLI gdcloud au chemin d'accès
Google vous recommande d'ajouter le répertoire bin de gdcloud CLI à votre chemin d'accès.
Lorsque le répertoire bin est ajouté à votre chemin :
Vous n'aurez pas à spécifier l'intégralité de la structure de répertoire à chaque commande.
Les composants essentiels de la CLI gdcloud sont installés dans le répertoire bin, ce qui permet aux commandes telles que gdcloud components de fonctionner correctement.
Ajoutez le répertoire bin de la CLI gdcloud à votre chemin d'accès :
Initialiser la configuration par défaut de la CLI gdcloud
Initialisez la configuration par défaut de la CLI gdcloud :
gdcloudinit
Suivez les instructions qui s'affichent pour initialiser la configuration. Vous devez fournir deux propriétés pour terminer l'initialisation :
organization_console_url : URL de la console de votre organisation GDC actuelle. Cette URL peut être globale ou zonale :
Pour une URL de console globale, utilisez la syntaxe https://console.ORG_NAME.SUFFIX, par exemple https://console.org-1.gdch.google.com.
Pour une URL de console zonale, utilisez la syntaxe https://console.ORG_NAME.ZONE.SUFFIX, par exemple https://console.org-1.zone-1.gdch.google.com.
project : nom de votre projet GDC actuel.
Affichez ces propriétés à l'aide de la commande gdcloud config list.
Gérer les composants de la CLI gdcloud
Les composants sont des parties installables de la CLI GDC. La CLI gdcloud est installée par défaut. Répertoriez, installez et mettez à jour les composants de la CLI gdcloud selon vos besoins.
Lister les composants
Affichez la liste actuelle des composants disponibles :
gdcloudcomponentslist
Installer les composants
Installez un composant sur la version actuelle de votre installation gdcloud CLI :
gdcloudcomponentsinstallCOMPONENT_ID
Par exemple, cette commande installe le composant kubectl :
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)."],[[["\u003cp\u003eThe gdcloud CLI requires adding its \u003ccode\u003ebin\u003c/code\u003e directory to your system's path for proper functionality and command execution.\u003c/p\u003e\n"],["\u003cp\u003eInitialization of the gdcloud CLI is performed using the \u003ccode\u003egdcloud init\u003c/code\u003e command and requires specifying the organization console URL and project name.\u003c/p\u003e\n"],["\u003cp\u003eThe organization console URL can be either global or zonal and must follow a specific syntax depending on the scope.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egdcloud components\u003c/code\u003e command suite allows for managing (listing, installing, updating) the individual parts of the GDC CLI.\u003c/p\u003e\n"],["\u003cp\u003eInstalled components can be accessed using their respective command names, such as \u003ccode\u003ekubectl\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Install the gdcloud CLI\n\nTo install and initialize the Distributed Cloud CLI,\n[download the CLI bundle](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-download) and complete\nthe following steps.\n\nAdd gdcloud CLI bin directory to path\n-------------------------------------\n\nGoogle recommends adding the gdcloud CLI `bin` directory to your\npath.\n\nWhen the `bin` directory is added to your path:\n\n- You won't have to specify the entire directory structure with each command.\n- Crucial gdcloud CLI components are installed in the `bin` directory that allow commands like `gdcloud components` to work correctly.\n\n| **Note:** The commands in the following sections assume the `google-distributed-cloud-hosted-cli` folder is in the current working directory.\n\nAdd the gdcloud CLI `bin` directory to your path: \n\n eval echo 'export GDCLOUD_PATH=$(pwd)/google-distributed-cloud-hosted-cli' \u003e\u003e ~/.bashrc\n echo 'export PATH=\"$GDCLOUD_PATH/bin:$PATH\"' \u003e\u003e ~/.bashrc\n source ~/.bashrc\n\nInitialize gdcloud CLI default configuration\n--------------------------------------------\n\nInitialize the gdcloud CLI default configuration: \n\n gdcloud init\n\nFollow the prompted instructions to initialize the configuration. You must\nprovide two properties to complete the initialization:\n\n- `organization_console_url`: The URL to your current GDC organization's console. This URL can be global or zonal:\n - For a global console URL, use the syntax `https://console.`\u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003eSUFFIX\u003c/var\u003e, such as `https://console.org-1.gdch.google.com`.\n - For a zonal console URL, use the syntax `https://console.`\u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003eSUFFIX\u003c/var\u003e, such as `https://console.org-1.zone-1.gdch.google.com`.\n- `project`: The name of your current GDC project.\n\nView these properties using the `gdcloud config list` command.\n\nManage gdcloud CLI components\n-----------------------------\n\nComponents are installable parts of the GDC CLI. The\ngdcloud CLI is installed by default. List, install, and update\ngdcloud CLI components as needed.\n\n### List components\n\nView the current list of available components: \n\n gdcloud components list\n\n### Install components\n\nInstall a component on the current version of your gdcloud CLI\ninstallation: \n\n gdcloud components install \u003cvar translate=\"no\"\u003eCOMPONENT_ID\u003c/var\u003e\n\nFor example, this command installs the `kubectl` component: \n\n gdcloud components install kubectl\n\n### Update components\n\nTo update all GDC components to the latest version of\nthe gdcloud CLI, see\n[Upgrade to the latest gdcloud CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-upgrade)."]]