CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-invoke

Pythonic task execution library for managing shell-oriented subprocesses and organizing executable Python code into CLI-invokable tasks

Overall
score

96%

Overview
Eval results
Files

task.mdevals/scenario-5/

Deployment Script with Safe Mode

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.

Capabilities

Preview Mode (Dry Run)

The script should support a preview mode that shows what commands would be executed without actually running them.

  • Calling 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 @test
  • Calling deploy_application(c, preview=False) with command ["mkdir /tmp/testdir"] creates the directory /tmp/testdir @test

Resilient Execution

The script should be able to continue executing subsequent commands even when earlier commands fail.

  • Calling deploy_application(c, resilient=True) with commands ["exit 1", "echo 'success'"] returns completed_steps containing both commands and success=True @test
  • Calling deploy_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

Implementation

@generates

API

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)
    """
    pass

Dependencies { .dependencies }

invoke { .dependency }

Provides task execution and shell command management capabilities.

Install with Tessl CLI

npx tessl i tessl/pypi-invoke

tile.json