kedro.framework.cli.hooks.specs.CLICommandSpecs

class kedro.framework.cli.hooks.specs.CLICommandSpecs[source]

Namespace that defines all specifications for Kedro CLI’s lifecycle hooks.

Methods

after_command_run(project_metadata, ...)

Hooks to be invoked after a CLI command runs.

before_command_run(project_metadata, ...)

Hooks to be invoked before a CLI command runs.

after_command_run(project_metadata, command_args, exit_code)[source]

Hooks to be invoked after a CLI command runs. It receives the project_metadata as well as all command line arguments that were used, including the command and subcommand themselves and if the operation was successful or not.

Parameters:
  • project_metadata (ProjectMetadata) – The Kedro project’s metadata.

  • command_args (list[str]) – The command line arguments that were used.

  • exit_code (int) – Exit code raised by Click application after completion

Return type:

None

before_command_run(project_metadata, command_args)[source]

Hooks to be invoked before a CLI command runs. It receives the project_metadata as well as all command line arguments that were used, including the command and subcommand themselves.

Parameters:
  • project_metadata (ProjectMetadata) – The Kedro project’s metadata.

  • command_args (list[str]) – The command line arguments that were used.

Return type:

None