On September 15, 2026, all Cloud Composer 1 versions and versions 2.0.x of Cloud Composer 2 will reach their planned end of life. You will not be able to use environments with these versions. We recommend planning migration to Cloud Composer 3. Cloud Composer 2 versions 2.1.x and later are still supported and are not impacted by this change.
Apache Airflow has a command-line interface (CLI) that you can use to perform
tasks such as triggering and managing DAGs, getting information about DAG runs
and tasks, adding and deleting connections and users.
Supported Airflow CLI commands
Airflow in Cloud Composer 1 provides two different syntaxes for CLI commands:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eCloud Composer 1 utilizes the Apache Airflow command-line interface (CLI) for managing tasks like triggering DAGs, accessing DAG run details, and handling connections and users.\u003c/p\u003e\n"],["\u003cp\u003eCloud Composer 1 supports two different syntaxes for CLI commands: Airflow 1.10 CLI syntax for environments with Airflow 1.10, and Airflow 2 CLI syntax for environments running Airflow 2.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud composer environments run\u003c/code\u003e command is used to execute Airflow CLI commands in Cloud Composer environments, requiring specification of the environment name, location, subcommand, and subcommand arguments.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the \u003ccode\u003egcloud composer environments run\u003c/code\u003e command, arguments for Airflow CLI subcommands should be separated by \u003ccode\u003e--\u003c/code\u003e, and different syntax rules apply for Airflow 1 and Airflow 2 environments.\u003c/p\u003e\n"],["\u003cp\u003eFor private IP environments, Airflow CLI commands must be run from a machine with access to the GKE cluster's control plane, and if public endpoint access is disabled, \u003ccode\u003ekubectl\u003c/code\u003e can be used directly with cluster credentials.\u003c/p\u003e\n"]]],[],null,["# Access Airflow command-line interface\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n[Cloud Composer 3](/composer/docs/composer-3/access-airflow-cli \"View this page for Cloud Composer 3\") \\| [Cloud Composer 2](/composer/docs/composer-2/access-airflow-cli \"View this page for Cloud Composer 2\") \\| **Cloud Composer 1**\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nApache Airflow has a command-line interface (CLI) that you can use to perform\ntasks such as triggering and managing DAGs, getting information about DAG runs\nand tasks, adding and deleting connections and users.\n\nSupported Airflow CLI commands\n------------------------------\n\n\u003cbr /\u003e\n\nAirflow in Cloud Composer 1 provides two different syntaxes for CLI commands:\n\n- [Airflow 1.10 CLI syntax](https://airflow.apache.org/docs/apache-airflow/1.10.12/cli-ref.html),\n available in Cloud Composer environments with Airflow 1.10.\n\n- [Airflow 2 CLI syntax](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html),\n available Cloud Composer environments with Airflow 2.\n\nFor a full list of supported Airflow CLI commands, see the reference for the\n[`gcloud composer environments run`](/sdk/gcloud/reference/composer/environments/run#SUBCOMMAND) command.\n\nBefore you begin\n----------------\n\n- You must have [permissions](/composer/docs/composer-1/access-control#cli) to use\n Google Cloud CLI with Cloud Composer and run Airflow CLI\n commands.\n\n | **Caution:** Users with the `composer.environments.executeairflowcommand` permission can execute Python code available to Airflow components on behalf of the environment's service account. For more information, see [Access control](/composer/docs/composer-1/access-control#service-account-security).\n- Airflow CLI commands consume the `environments.executeAirflowCommand`\n [quota](/composer/quotas).\n\n | **Important:** If you want to trigger a large number of DAGs, we recommend to do it [with Airflow REST API](/composer/docs/composer-1/access-airflow-api#call-api). Triggering DAGs through Google Cloud CLI might cause your environment to reach the quota limit, and as a result, Airflow CLI commands will no longer be executed.\n\nRun Airflow CLI commands\n------------------------\n\nTo run Airflow CLI commands in your environments, use gcloud CLI: \n\n gcloud composer environments run \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003eSUBCOMMAND\u003c/var\u003e \\\n -- \u003cvar translate=\"no\"\u003eSUBCOMMAND_ARGUMENTS\u003c/var\u003e\n\nReplace the following :\n\n- `ENVIRONMENT_NAME`: the name of your environment.\n- `LOCATION`: the region where the environment is located.\n- `SUBCOMMAND`: one of the [supported Airflow CLI commands](/sdk/gcloud/reference/composer/environments/run#SUBCOMMAND).\n- `SUBCOMMAND_ARGUMENTS` with arguments for the Airflow CLI command.\n\n### Sub-command arguments separator\n\nSeparate the arguments for the specified Airflow CLI command with `--`:\n\n\u003cbr /\u003e\n\n### Airflow 2\n\n\n- Specify compound CLI commands as a sub-command.\n- Specify any arguments for compound commands as sub-command arguments, after a `--` separator.\n\nExample: \n\n gcloud composer environments run example-environment \\\n dags list -- --output=json\n\n\u003cbr /\u003e\n\n### Airflow 1\n\n\n- Specify CLI commands as a sub-command.\n- Specify any arguments after a `--` separator.\n\nExample: \n\n gcloud composer environments run example-environment \\\n list_dags -- --report\n\n\u003cbr /\u003e\n\n### Default location\n\nMost `gcloud composer` commands require a location. You can specify the\nlocation with the `--location` flag, or by\n[setting the default location](/composer/docs/gcloud-installation#set-default).\n\nFor example, to trigger a DAG named `sample_quickstart` with the ID `5077` in\nyour Cloud Composer environment:\n\n\u003cbr /\u003e\n\n### Airflow 2\n\n\n gcloud composer environments run example-environment \\\n --location us-central1 dags trigger -- sample_quickstart \\\n --run-id=5077\n\n\u003cbr /\u003e\n\n### Airflow 1\n\n\n gcloud composer environments run example-environment \\\n --location us-central1 trigger_dag -- sample_quickstart \\\n --run_id=5077\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- [Access Airflow UI](/composer/docs/composer-1/access-airflow-web-interface)\n- [Access control (Airflow CLI)](/composer/docs/composer-1/access-control#cli)"]]