[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eThis page explains how to use the Google Cloud CLI tool to interact with Cloud Composer environments.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the \u003ccode\u003egcloud composer\u003c/code\u003e commands, the Cloud Composer API must be enabled, and Google Cloud CLI needs to be installed on your local client.\u003c/p\u003e\n"],["\u003cp\u003eYou can set a default project and location for Cloud Composer using the \u003ccode\u003egcloud config set\u003c/code\u003e command, eliminating the need to repeatedly specify them with each command.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--help\u003c/code\u003e flag can be used with \u003ccode\u003egcloud composer\u003c/code\u003e commands to display help information, which is also available in the Google Cloud CLI reference documentation.\u003c/p\u003e\n"]]],[],null,["# Using Google Cloud CLI with Cloud Composer\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page describes how to get started using Google Cloud CLI with\nCloud Composer environments.\n\nBefore you begin\n----------------\n\n- Google Cloud CLI uses Cloud Composer API to run `gcloud composer` commands, so you must [enable the API](/composer/docs/latest/enable-composer-service).\n- Install [Google Cloud CLI](/sdk/docs/install) on your local client.\n\nGetting started with the gcloud command-line tool\n-------------------------------------------------\n\nYou can manage and access Cloud Composer environments\nwith `gcloud composer` commands provided by\n[Google Cloud CLI](/sdk/docs).\n\nTo start with the `gcloud` tool, review\nthe [Google Cloud CLI documentation](/sdk/docs).\nYou can get help for the tool, resources, and commands by using the `--help`\nflag: \n\n gcloud composer environments --help\n\nThe help displayed with the `--help` flag is also available in the\n[Google Cloud CLI reference](/sdk/gcloud/reference/composer) for `gcloud composer`.\n\nSetting the default project and location in your local client\n-------------------------------------------------------------\n\nMost `gcloud composer` commands require a location. You can specify the\nlocation by using the `--location` flag or by setting the default location.\n\nTo set the default project and location for Cloud Composer:\n\n1. Set the default project by running the following command:\n\n gcloud config set project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace the following:\n - `PROJECT_ID`: the [Project ID](/resource-manager/docs/creating-managing-projects) of the project where your Cloud Composer environment is located.\n2. Configure the Cloud Composer location by running the following\n command:\n\n gcloud config set composer/location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\n Replace the following:\n - `LOCATION`: the region where the environment is located, such as `us-central1` or `europe-west1`.\n3. (Optional) To list the configuration for Google Cloud CLI, you can run the\n following command:\n\n gcloud config list\n\nWhat's next\n-----------\n\n- [Add and update Airflow DAGs](/composer/docs/latest/manage-dags)\n- [`gcloud composer` reference](/sdk/gcloud/reference/composer)\n- [`gcloud beta composer` reference](/sdk/gcloud/reference/beta/composer)"]]