Files
crewAI/src/crewai/cli/replay_from_task.py
2025-05-12 13:30:50 +00:00

26 lines
692 B
Python

import subprocess
import click
def replay_task_command(task_id: str) -> None:
"""Replay the crew execution from a specific task.
Args:
task_id (str): The ID of the task to replay from.
"""
command = ["uv", "run", "replay", task_id]
try:
result = subprocess.run(command, capture_output=False, text=True, check=True)
if result.stderr:
click.echo(result.stderr, err=True)
except subprocess.CalledProcessError as e:
click.echo(f"An error occurred while replaying the task: {e}", err=True)
click.echo(e.output, err=True)
except Exception as e:
click.echo(f"An unexpected error occurred: {e}", err=True)