Pythonic task execution library for managing shell-oriented subprocesses and organizing executable Python code into CLI-invokable tasks
Overall
score
96%
A deployment automation script that can perform system operations with safety controls. The script should support previewing commands before execution and continuing operations even when individual commands fail.
The script should support a preview mode that shows what commands would be executed without actually running them.
deploy_application(c, preview=True) with commands ["echo 'test'", "mkdir /tmp/testdir"] returns completed_steps containing both commands, but the directory /tmp/testdir is not created @testdeploy_application(c, preview=False) with command ["mkdir /tmp/testdir"] creates the directory /tmp/testdir @testThe script should be able to continue executing subsequent commands even when earlier commands fail.
deploy_application(c, resilient=True) with commands ["exit 1", "echo 'success'"] returns completed_steps containing both commands and success=True @testdeploy_application(c, resilient=False) with commands ["exit 1", "echo 'success'"] stops after the first command and returns success=False with only one item in completed_steps @test@generates
from invoke import Context
def deploy_application(c: Context, commands: list, preview: bool = False, resilient: bool = False) -> dict:
"""
Deploy the application with configurable safety controls.
Args:
c: The invoke context for running commands
commands: List of shell commands to execute
preview: If True, show commands without executing them
resilient: If True, continue execution even if commands fail
Returns:
A dictionary with keys 'success' (bool) and 'completed_steps' (list of str)
"""
passProvides task execution and shell command management capabilities.
Install with Tessl CLI
npx tessl i tessl/pypi-invokedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10