diff --git a/airflow-ctl/README.md b/airflow-ctl/README.md index 5cd15ca5513..de8989f7cb9 100644 --- a/airflow-ctl/README.md +++ b/airflow-ctl/README.md @@ -67,4 +67,4 @@ You can check each command with `airflowctl --help` to see the availab #### Implemented Commands Implemented commands are the ones which are not auto generated and need to be implemented manually. -You can check the implemented commands under `airflow-ctl/src/airflowctl/clt/commands/`. +You can check the implemented commands under `airflow-ctl/src/airflowctl/ctl/commands/`. diff --git a/airflow-ctl/docs/howto/index.rst b/airflow-ctl/docs/howto/index.rst index a8efd3a602e..51e4ebc42a5 100644 --- a/airflow-ctl/docs/howto/index.rst +++ b/airflow-ctl/docs/howto/index.rst @@ -43,7 +43,7 @@ Let's take example of triggering a Dag run with a logical date, run after and a .. code-block:: bash - airflowctl dagrun trigger --dag-id="example_bash_operator" --logical-date="2025-09-06T00:00:00+00:00" --run-after="2025-09-06T00:00:00+00:00" --note="Triggered from airflowctl" + airflowctl dags trigger example_bash_operator --logical-date="2025-09-06T00:00:00+00:00" --run-after="2025-09-06T00:00:00+00:00" --note="Triggered from airflowctl" Login diff --git a/airflow-ctl/docs/images/command_hashes.txt b/airflow-ctl/docs/images/command_hashes.txt index 4c9906ab2b2..0c1bf556267 100644 --- a/airflow-ctl/docs/images/command_hashes.txt +++ b/airflow-ctl/docs/images/command_hashes.txt @@ -1,6 +1,6 @@ main:2c358f5fc894541cab11854dcd67658a assets:fa2bceb5343af0d3cda2a1594d95787e -auth:d79e9c7d00c432bdbcbc2a86e2e32053 +auth:5aeefc79ee662adbd7cbfb51e1c1de4b backfill:74c8737b0a62a86ed3605fa9e6165874 config:a3d936cb15fe3b547bf6c82cf93d923f connections:942f9f88cb908c28bf5c19159fc5065b @@ -14,4 +14,4 @@ tasks:eb70701dfe1b9baeda39d5eea07fde5f variables:f8fc76d3d398b2780f4e97f7cd816646 version:31f4efdf8de0dbaaa4fac71ff7efecc3 plugins:4864fd8f356704bd2b3cd1aec3567e35 -auth login:9fe2bb1dd5c602beea2eefb33a2b20a8 +auth login:963355e38ab1c133f2cf9495d00d99f6 diff --git a/airflow-ctl/docs/images/output_auth.svg b/airflow-ctl/docs/images/output_auth.svg index 7e697a2bb1a..604a3f900f4 100644 --- a/airflow-ctl/docs/images/output_auth.svg +++ b/airflow-ctl/docs/images/output_auth.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - - Usage:airflowctl auth [-h] COMMAND... - -Manage authentication for CLI. Either pass token from environment  -variable/parameter or pass username and password. - -Positional Arguments: -COMMAND -list-envs -List all CLI environments that the user has logged into -loginLogin to the metadata database for personal usage. JWT Token  -must be provided via parameter. -tokenGenerate and print a JWT token for the given credentials - -Options: --h, --helpshow this help message and exit + + Usage:airflowctl auth [-h] COMMAND... + +Manage authentication for CLI. Either pass token from environment  +variable/parameter or pass username and password. + +Positional Arguments: +COMMAND +list-envs +List all CLI environments that the user has logged into +loginLog in to the Airflow API server with an API token or a  +username and password +tokenGenerate and print a JWT token for the given credentials + +Options: +-h, --helpshow this help message and exit + diff --git a/airflow-ctl/docs/images/output_auth_login.svg b/airflow-ctl/docs/images/output_auth_login.svg index 754353b3c68..f722fb20eb3 100644 --- a/airflow-ctl/docs/images/output_auth_login.svg +++ b/airflow-ctl/docs/images/output_auth_login.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - - Usage:airflowctl auth login [-h] [--api-tokenAPI_TOKEN] -                             [--api-urlAPI_URL] [-eENV] -                             [--passwordPASSWORD] [--skip-keyring] -                             [--usernameUSERNAME] - -Login to the metadata database - -Options: --h, --helpshow this help message and exit ---api-tokenAPI_TOKEN -The token to use for authentication ---api-urlAPI_URLThe URL of the metadata database API --e, --envENVThe environment to run the command in ---passwordPASSWORDThe password to use for authentication ---skip-keyringSkip storing credentials in keyring ---usernameUSERNAMEThe username to use for authentication + + Usage:airflowctl auth login [-h] [--api-tokenAPI_TOKEN] +                             [--api-urlAPI_URL] [-eENV] +                             [--passwordPASSWORD] [--skip-keyring] +                             [--usernameUSERNAME] + +Log in to the Airflow API server and store the credentials for the selected +environment. Pass --api-token (or set AIRFLOW_CLI_TOKEN), or --username and +--password; missing credentials are prompted for when running in a  +terminal. + +Options: +-h, --helpshow this help message and exit +--api-tokenAPI_TOKEN +The token to use for authentication +--api-urlAPI_URLThe URL of the Airflow API server +-e, --envENVThe environment to run the command in +--passwordPASSWORDThe password to use for authentication +--skip-keyringSkip storing credentials in keyring +--usernameUSERNAMEThe username to use for authentication + diff --git a/airflow-ctl/src/airflowctl/ctl/cli_config.py b/airflow-ctl/src/airflowctl/ctl/cli_config.py index 25f01bf5f76..f6deacfeb25 100755 --- a/airflow-ctl/src/airflowctl/ctl/cli_config.py +++ b/airflow-ctl/src/airflowctl/ctl/cli_config.py @@ -248,7 +248,7 @@ ARG_AUTH_URL = Arg( type=str, default="http://localhost:8080", dest="api_url", - help="The URL of the metadata database API", + help="The URL of the Airflow API server", ) ARG_AUTH_TOKEN = Arg( flags=("--api-token",), @@ -1074,8 +1074,12 @@ command_factory = CommandFactory() AUTH_COMMANDS = ( ActionCommand( name="login", - help="Login to the metadata database for personal usage. JWT Token must be provided via parameter.", - description="Login to the metadata database", + help="Log in to the Airflow API server with an API token or a username and password", + description=( + "Log in to the Airflow API server and store the credentials for the selected environment. " + "Pass --api-token (or set AIRFLOW_CLI_TOKEN), or --username and --password; " + "missing credentials are prompted for when running in a terminal." + ), func=lazy_load_command("airflowctl.ctl.commands.auth_command.login"), args=( ARG_AUTH_URL,