Add version command to CLI (#348)

* feat: add version command to cli with tools flag

* test: check output of version and tools flag

* fix: add version tool info to cli outputs
This commit is contained in:
Jason Schrader
2024-05-15 15:50:49 -07:00
committed by GitHub
parent 1e112fa50a
commit 208c3a780c
2 changed files with 38 additions and 0 deletions

20
tests/cli_test.py Normal file
View File

@@ -0,0 +1,20 @@
from click.testing import CliRunner
from crewai.cli.cli import version
def test_version_command():
runner = CliRunner()
result = runner.invoke(version)
assert result.exit_code == 0
assert "crewai version:" in result.output
def test_version_command_with_tools():
runner = CliRunner()
result = runner.invoke(version, ["--tools"])
assert result.exit_code == 0
assert "crewai version:" in result.output
assert (
"crewai tools version:" in result.output
or "crewai tools not installed" in result.output
)