tessl install tessl/pypi-invoke@2.2.0Pythonic task execution library for managing shell-oriented subprocesses and organizing executable Python code into CLI-invokable tasks
Agent Success
Agent success rate when using this tile
96%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.25x
Baseline
Agent success rate without this tile
77%
Build a task automation system that executes interactive shell commands and automatically responds to prompts by monitoring output patterns.
Implement two task functions that execute commands which prompt for user input. Your implementation should automatically respond to these prompts by watching for specific patterns in the command output.
Execute a simulated deployment command (e.g., a script that echoes "Do you want to continue? (yes/no):" and waits for input). The task should automatically respond with "yes\n" when this pattern is detected.
Execute a simulated secure command (e.g., a script that echoes "Enter passphrase:" and waits for input). The task should automatically respond with "secret123\n" when this pattern is detected.
automated_deployment task executes a Python script that prints "Do you want to continue? (yes/no):" to stdout and reads from stdin. The task automatically responds with "yes\n" and the script prints "Continuing..." and exits with code 0. @testsecure_operation task executes a Python script that prints "Enter passphrase:" to stdout and reads from stdin. The task automatically responds with "secret123\n" and the script prints "Access granted" and exits with code 0. @test@generates
from invoke import task, Context
@task
def automated_deployment(c: Context) -> None:
"""
Execute a simulated deployment command that prompts for confirmation.
Runs a command that outputs "Do you want to continue? (yes/no):"
and automatically responds with "yes\n".
Args:
c: Invoke context object for running commands
"""
pass
@task
def secure_operation(c: Context) -> None:
"""
Execute a simulated secure command that prompts for a passphrase.
Runs a command that outputs "Enter passphrase:"
and automatically responds with "secret123\n".
Args:
c: Invoke context object for running commands
"""
passProvides task automation and subprocess execution capabilities.