mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
* feat: add cli to run the crew * feat: change command to run_crew * feat: change pyprojet to run_Crew * docs: change docs to address crewai run
24 lines
615 B
Python
24 lines
615 B
Python
import subprocess
|
|
|
|
import click
|
|
|
|
|
|
def run_crew() -> None:
|
|
"""
|
|
Run the crew by running a command in the Poetry environment.
|
|
"""
|
|
command = ["poetry", "run", "run_crew"]
|
|
|
|
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 running the crew: {e}", err=True)
|
|
click.echo(e.output, err=True)
|
|
|
|
except Exception as e:
|
|
click.echo(f"An unexpected error occurred: {e}", err=True)
|