mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 23:58:34 +00:00
version implemented
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import click
|
||||
|
||||
import pkg_resources
|
||||
from .create_crew import create_crew
|
||||
|
||||
|
||||
@@ -15,5 +15,22 @@ def create(project_name):
|
||||
create_crew(project_name)
|
||||
|
||||
|
||||
@crewai.command()
|
||||
@click.option(
|
||||
"--tools", is_flag=True, help="Show the installed version of crewai tools"
|
||||
)
|
||||
def version(tools):
|
||||
"""Show the installed version of crewai."""
|
||||
crewai_version = pkg_resources.get_distribution("crewai").version
|
||||
click.echo(f"crewai version: {crewai_version}")
|
||||
|
||||
if tools:
|
||||
try:
|
||||
tools_version = pkg_resources.get_distribution("crewai[tools]").version
|
||||
click.echo(f"crewai tools version: {tools_version}")
|
||||
except pkg_resources.DistributionNotFound:
|
||||
click.echo("crewai tools not installed")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
crewai()
|
||||
|
||||
Reference in New Issue
Block a user