forked from crewAIInc/crewAI
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cli to run the crew (crewAIInc#1080)
* 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
- Loading branch information
1 parent
86c6760
commit 297dc93
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters