diff --git a/CHANGELOG.cdf-tk.md b/CHANGELOG.cdf-tk.md index 6752b615d..2b3459d13 100644 --- a/CHANGELOG.cdf-tk.md +++ b/CHANGELOG.cdf-tk.md @@ -36,6 +36,8 @@ Changes are grouped as follows: the required value no longer triggers a redeploy. - `LocationFilters` now parses the `version` key of `View` and `DataModel` correctly as a string. - `LocationFilters` now converts an empty string of `dataSetExternalId` to `0` instead of ignoring it. +- All commands now has a verbose flag `--verbose`. Not all commands have an `--verbose` output, but + error handling has a more verbose output which applies to all commands. ## [0.3.23] - 2024-12-13 diff --git a/cognite_toolkit/_cdf_tk/apps/_auth_app.py b/cognite_toolkit/_cdf_tk/apps/_auth_app.py index c45cd6902..35fbc859d 100644 --- a/cognite_toolkit/_cdf_tk/apps/_auth_app.py +++ b/cognite_toolkit/_cdf_tk/apps/_auth_app.py @@ -37,6 +37,14 @@ def init( help="If you verify, and you pass this flag no changes to CDF will be made.", ), ] = False, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """Sets the OIDC parameters required to authenticate and authorize the Cognite Toolkit in Cognite Data Fusion. @@ -74,6 +82,14 @@ def verify( "If you include this flag, the execution will stop if the user or service principal does not have the required capabilities.", ), ] = False, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """Verify that the current user or service principal has the required capabilities to run the CDF Toolkit commands.""" cmd = AuthCommand() diff --git a/cognite_toolkit/_cdf_tk/apps/_modules_app.py b/cognite_toolkit/_cdf_tk/apps/_modules_app.py index 8ecd242de..df2a36a79 100644 --- a/cognite_toolkit/_cdf_tk/apps/_modules_app.py +++ b/cognite_toolkit/_cdf_tk/apps/_modules_app.py @@ -53,6 +53,14 @@ def init( help="Clean target directory if it exists", ), ] = False, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """Initialize or upgrade a new CDF project with templates interactively.""" @@ -100,6 +108,14 @@ def add( help="Path to project directory with the modules. This is used to search for available functions.", ), ] = CDF_TOML.cdf.default_organization_dir, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """Add one or more new module(s) to the project.""" cmd = ModulesCommand() @@ -179,6 +195,14 @@ def list( help="Build environment to use.", ), ] = CDF_TOML.cdf.default_env, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """List all available modules in the project.""" cmd = ModulesCommand() diff --git a/cognite_toolkit/_cdf_tk/apps/_run.py b/cognite_toolkit/_cdf_tk/apps/_run.py index 0a0bf7288..e6df9295d 100644 --- a/cognite_toolkit/_cdf_tk/apps/_run.py +++ b/cognite_toolkit/_cdf_tk/apps/_run.py @@ -43,6 +43,14 @@ def run_transformation( help="External id of the transformation to run.", ), ], + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """This command will run the specified transformation using a one-time session.""" cmd = RunTransformationCommand() @@ -93,6 +101,14 @@ def run_workflow( help="Whether to wait for the workflow to complete.", ), ] = False, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """This command will run the specified workflow.""" cmd = RunWorkflowCommand() @@ -158,6 +174,14 @@ def run_local( help="Whether to rebuild the environment before running the function.", ), ] = False, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """This command will run the specified function locally.""" cmd = RunFunctionCommand() @@ -214,6 +238,14 @@ def run_cdf( help="Whether to wait for the function to complete.", ), ] = False, + verbose: Annotated[ + bool, + typer.Option( + "--verbose", + "-v", + help="Turn on to get more verbose output when running the command", + ), + ] = False, ) -> None: """This command will run the specified function (assuming it is deployed) in CDF.""" cmd = RunFunctionCommand()