This is an automated email from the ASF dual-hosted git repository.

vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8a13c06a001 fix(airflowctl): enhance API token handling and update CLI 
argument list (#55430)
8a13c06a001 is described below

commit 8a13c06a001ba66449da4c64abd0571b2d01acb2
Author: Bugra Ozturk <[email protected]>
AuthorDate: Thu Sep 11 15:00:29 2025 +0200

    fix(airflowctl): enhance API token handling and update CLI argument list 
(#55430)
---
 airflow-ctl/src/airflowctl/api/client.py     | 2 +-
 airflow-ctl/src/airflowctl/ctl/cli_config.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow-ctl/src/airflowctl/api/client.py 
b/airflow-ctl/src/airflowctl/api/client.py
index 4f2ee2fbd8d..2c0824f9aff 100644
--- a/airflow-ctl/src/airflowctl/api/client.py
+++ b/airflow-ctl/src/airflowctl/api/client.py
@@ -299,7 +299,7 @@ def get_client(kind: Literal[ClientKind.CLI, 
ClientKind.AUTH] = ClientKind.CLI):
         api_client = Client(
             base_url=credentials.api_url or "http://localhost:8080";,
             limits=httpx.Limits(max_keepalive_connections=1, 
max_connections=1),
-            token=credentials.api_token or "",
+            token=credentials.api_token or str(os.getenv("AIRFLOW_CLI_TOKEN", 
"")),
             kind=kind,
         )
         yield api_client
diff --git a/airflow-ctl/src/airflowctl/ctl/cli_config.py 
b/airflow-ctl/src/airflowctl/ctl/cli_config.py
index ae1e8bcb755..b6958df426c 100644
--- a/airflow-ctl/src/airflowctl/ctl/cli_config.py
+++ b/airflow-ctl/src/airflowctl/ctl/cli_config.py
@@ -560,7 +560,7 @@ class CommandFactory:
                         )
 
             if any(operation.get("name").startswith(cmd) for cmd in 
self.output_command_list):
-                args.extend([ARG_OUTPUT])
+                args.extend([ARG_OUTPUT, ARG_AUTH_ENVIRONMENT])
 
             self.args_map[(operation.get("name"), 
operation.get("parent").name)] = args
 

Reply via email to