Getting started
Install prefect-shell
The following command will install a version of prefect-shell compatible with your installed version of prefect.
If you don’t already have prefect installed, it will install the newest version of prefect as well.
prefect and prefect-shell:
Register newly installed block types
Register the block types in theprefect-shell module to make them available for use.
Examples
Integrate shell commands with Prefect flows
Withprefect-shell, you can use shell commands (and/or scripts) in Prefect flows to provide observability and resiliency.
prefect-shell can be a useful tool if you’re transitioning your orchestration from shell scripts to Prefect.
Let’s get the shell-abration started!
The Python code below has shell commands embedded in a Prefect flow:
Save shell commands in Prefect blocks
You can save commands within aShellOperation block, then reuse them across multiple flows.
Save the block with desired commands:
Resources
Refer to theprefect-shell SDK documentation to explore all the capabilities of the prefect-shell library.