crewai-cli 1.14.5a3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crewai_cli/__init__.py +1 -0
- crewai_cli/add_crew_to_flow.py +73 -0
- crewai_cli/authentication/__init__.py +8 -0
- crewai_cli/authentication/constants.py +8 -0
- crewai_cli/authentication/main.py +60 -0
- crewai_cli/authentication/providers/__init__.py +1 -0
- crewai_cli/authentication/providers/auth0.py +8 -0
- crewai_cli/authentication/providers/base_provider.py +8 -0
- crewai_cli/authentication/providers/entra_id.py +8 -0
- crewai_cli/authentication/providers/keycloak.py +8 -0
- crewai_cli/authentication/providers/okta.py +8 -0
- crewai_cli/authentication/providers/workos.py +8 -0
- crewai_cli/authentication/token.py +11 -0
- crewai_cli/authentication/utils.py +8 -0
- crewai_cli/checkpoint_cli.py +732 -0
- crewai_cli/checkpoint_tui.py +877 -0
- crewai_cli/cli.py +960 -0
- crewai_cli/command.py +77 -0
- crewai_cli/config.py +30 -0
- crewai_cli/constants.py +333 -0
- crewai_cli/create_crew.py +321 -0
- crewai_cli/create_flow.py +103 -0
- crewai_cli/crew_chat.py +23 -0
- crewai_cli/deploy/__init__.py +0 -0
- crewai_cli/deploy/main.py +308 -0
- crewai_cli/deploy/validate.py +845 -0
- crewai_cli/enterprise/__init__.py +0 -0
- crewai_cli/enterprise/main.py +125 -0
- crewai_cli/evaluate_crew.py +41 -0
- crewai_cli/git.py +89 -0
- crewai_cli/install_crew.py +32 -0
- crewai_cli/kickoff_flow.py +23 -0
- crewai_cli/memory_tui.py +403 -0
- crewai_cli/organization/__init__.py +1 -0
- crewai_cli/organization/main.py +107 -0
- crewai_cli/plot_flow.py +23 -0
- crewai_cli/plus_api.py +12 -0
- crewai_cli/provider.py +231 -0
- crewai_cli/py.typed +0 -0
- crewai_cli/remote_template/__init__.py +0 -0
- crewai_cli/remote_template/main.py +250 -0
- crewai_cli/replay_from_task.py +34 -0
- crewai_cli/reset_memories_command.py +31 -0
- crewai_cli/run_crew.py +101 -0
- crewai_cli/settings/__init__.py +0 -0
- crewai_cli/settings/main.py +110 -0
- crewai_cli/shared/__init__.py +0 -0
- crewai_cli/shared/token_manager.py +12 -0
- crewai_cli/task_outputs.py +67 -0
- crewai_cli/templates/AGENTS.md +1017 -0
- crewai_cli/templates/__init__.py +0 -0
- crewai_cli/templates/crew/.gitignore +3 -0
- crewai_cli/templates/crew/README.md +54 -0
- crewai_cli/templates/crew/__init__.py +0 -0
- crewai_cli/templates/crew/config/agents.yaml +19 -0
- crewai_cli/templates/crew/config/tasks.yaml +17 -0
- crewai_cli/templates/crew/crew.py +63 -0
- crewai_cli/templates/crew/knowledge/user_preference.txt +4 -0
- crewai_cli/templates/crew/main.py +94 -0
- crewai_cli/templates/crew/pyproject.toml +24 -0
- crewai_cli/templates/crew/tools/__init__.py +0 -0
- crewai_cli/templates/crew/tools/custom_tool.py +19 -0
- crewai_cli/templates/flow/.gitignore +4 -0
- crewai_cli/templates/flow/README.md +56 -0
- crewai_cli/templates/flow/__init__.py +0 -0
- crewai_cli/templates/flow/crews/content_crew/config/agents.yaml +33 -0
- crewai_cli/templates/flow/crews/content_crew/config/tasks.yaml +50 -0
- crewai_cli/templates/flow/crews/content_crew/content_crew.py +75 -0
- crewai_cli/templates/flow/main.py +92 -0
- crewai_cli/templates/flow/pyproject.toml +22 -0
- crewai_cli/templates/flow/tools/__init__.py +0 -0
- crewai_cli/templates/flow/tools/custom_tool.py +21 -0
- crewai_cli/templates/tool/.gitignore +10 -0
- crewai_cli/templates/tool/README.md +48 -0
- crewai_cli/templates/tool/pyproject.toml +12 -0
- crewai_cli/templates/tool/src/{{folder_name}}/__init__.py +3 -0
- crewai_cli/templates/tool/src/{{folder_name}}/tool.py +10 -0
- crewai_cli/tools/__init__.py +0 -0
- crewai_cli/tools/main.py +364 -0
- crewai_cli/train_crew.py +32 -0
- crewai_cli/triggers/__init__.py +6 -0
- crewai_cli/triggers/main.py +137 -0
- crewai_cli/update_crew.py +122 -0
- crewai_cli/user_data.py +22 -0
- crewai_cli/utils.py +137 -0
- crewai_cli/version.py +24 -0
- crewai_cli-1.14.5a3.dist-info/METADATA +51 -0
- crewai_cli-1.14.5a3.dist-info/RECORD +90 -0
- crewai_cli-1.14.5a3.dist-info/WHEEL +4 -0
- crewai_cli-1.14.5a3.dist-info/entry_points.txt +2 -0
crewai_cli/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.14.5a3"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
from crewai_core.printer import PRINTER
|
|
5
|
+
|
|
6
|
+
from crewai_cli.utils import copy_template
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def add_crew_to_flow(crew_name: str) -> None:
|
|
10
|
+
"""Add a new crew to the current flow."""
|
|
11
|
+
# Check if pyproject.toml exists in the current directory
|
|
12
|
+
if not Path("pyproject.toml").exists():
|
|
13
|
+
PRINTER.print(
|
|
14
|
+
"This command must be run from the root of a flow project.", color="red"
|
|
15
|
+
)
|
|
16
|
+
raise click.ClickException(
|
|
17
|
+
"This command must be run from the root of a flow project."
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
# Determine the flow folder based on the current directory
|
|
21
|
+
flow_folder = Path.cwd()
|
|
22
|
+
crews_folder = flow_folder / "src" / flow_folder.name / "crews"
|
|
23
|
+
|
|
24
|
+
if not crews_folder.exists():
|
|
25
|
+
PRINTER.print("Crews folder does not exist in the current flow.", color="red")
|
|
26
|
+
raise click.ClickException("Crews folder does not exist in the current flow.")
|
|
27
|
+
|
|
28
|
+
# Create the crew within the flow's crews directory
|
|
29
|
+
create_embedded_crew(crew_name, parent_folder=crews_folder)
|
|
30
|
+
|
|
31
|
+
click.echo(
|
|
32
|
+
f"Crew {crew_name} added to the current flow successfully!",
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def create_embedded_crew(crew_name: str, parent_folder: Path) -> None:
|
|
37
|
+
"""Create a new crew within an existing flow project."""
|
|
38
|
+
folder_name = crew_name.replace(" ", "_").replace("-", "_").lower()
|
|
39
|
+
class_name = crew_name.replace("_", " ").replace("-", " ").title().replace(" ", "")
|
|
40
|
+
|
|
41
|
+
crew_folder = parent_folder / folder_name
|
|
42
|
+
|
|
43
|
+
if crew_folder.exists():
|
|
44
|
+
if not click.confirm(
|
|
45
|
+
f"Crew {folder_name} already exists. Do you want to override it?"
|
|
46
|
+
):
|
|
47
|
+
click.secho("Operation cancelled.", fg="yellow")
|
|
48
|
+
return
|
|
49
|
+
click.secho(f"Overriding crew {folder_name}...", fg="green", bold=True)
|
|
50
|
+
else:
|
|
51
|
+
click.secho(f"Creating crew {folder_name}...", fg="green", bold=True)
|
|
52
|
+
crew_folder.mkdir(parents=True)
|
|
53
|
+
|
|
54
|
+
# Create config and crew.py files
|
|
55
|
+
config_folder = crew_folder / "config"
|
|
56
|
+
config_folder.mkdir(exist_ok=True)
|
|
57
|
+
|
|
58
|
+
templates_dir = Path(__file__).parent / "templates" / "crew"
|
|
59
|
+
config_template_files = ["agents.yaml", "tasks.yaml"]
|
|
60
|
+
crew_template_file = f"{folder_name}.py" # Updated file name
|
|
61
|
+
|
|
62
|
+
for file_name in config_template_files:
|
|
63
|
+
src_file = templates_dir / "config" / file_name
|
|
64
|
+
dst_file = config_folder / file_name
|
|
65
|
+
copy_template(src_file, dst_file, crew_name, class_name, folder_name)
|
|
66
|
+
|
|
67
|
+
src_file = templates_dir / "crew.py"
|
|
68
|
+
dst_file = crew_folder / crew_template_file
|
|
69
|
+
copy_template(src_file, dst_file, crew_name, class_name, folder_name)
|
|
70
|
+
|
|
71
|
+
click.secho(
|
|
72
|
+
f"Crew {crew_name} added to the flow successfully!", fg="green", bold=True
|
|
73
|
+
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""CLI-side authentication wiring.
|
|
2
|
+
|
|
3
|
+
Re-exports the OAuth2 primitives from ``crewai_core.auth`` and overrides the
|
|
4
|
+
``_post_login`` hook to also log into the tool repository.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from crewai_core.auth.oauth2 import (
|
|
10
|
+
AuthenticationCommand as _BaseAuthenticationCommand,
|
|
11
|
+
Oauth2Settings as Oauth2Settings,
|
|
12
|
+
ProviderFactory as ProviderFactory,
|
|
13
|
+
console,
|
|
14
|
+
)
|
|
15
|
+
from crewai_core.settings import Settings
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
__all__ = ["AuthenticationCommand", "Oauth2Settings", "ProviderFactory"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AuthenticationCommand(_BaseAuthenticationCommand):
|
|
22
|
+
"""CLI-side login that also signs the user into the tool repository."""
|
|
23
|
+
|
|
24
|
+
def _post_login(self) -> None:
|
|
25
|
+
self._login_to_tool_repository()
|
|
26
|
+
|
|
27
|
+
def _login_to_tool_repository(self) -> None:
|
|
28
|
+
from crewai_cli.tools.main import ToolCommand
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
console.print(
|
|
32
|
+
"Now logging you in to the Tool Repository... ",
|
|
33
|
+
style="bold blue",
|
|
34
|
+
end="",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
ToolCommand().login()
|
|
38
|
+
|
|
39
|
+
console.print(
|
|
40
|
+
"Success!\n",
|
|
41
|
+
style="bold green",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
settings = Settings()
|
|
45
|
+
|
|
46
|
+
console.print(
|
|
47
|
+
f"You are now authenticated to the tool repository for organization [bold cyan]'{settings.org_name if settings.org_name else settings.org_uuid}'[/bold cyan]",
|
|
48
|
+
style="green",
|
|
49
|
+
)
|
|
50
|
+
except (Exception, SystemExit):
|
|
51
|
+
console.print(
|
|
52
|
+
"\n[bold yellow]Warning:[/bold yellow] Authentication with the Tool Repository failed.",
|
|
53
|
+
style="yellow",
|
|
54
|
+
)
|
|
55
|
+
console.print(
|
|
56
|
+
"Other features will work normally, but you may experience limitations "
|
|
57
|
+
"with downloading and publishing tools."
|
|
58
|
+
"\nRun [bold]crewai login[/bold] to try logging in again.\n",
|
|
59
|
+
style="yellow",
|
|
60
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""OAuth2 authentication providers — re-exported from ``crewai_core.auth.providers``."""
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Re-exports of authentication token helpers from ``crewai_core.auth.token``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from crewai_core.auth.token import (
|
|
6
|
+
AuthError as AuthError,
|
|
7
|
+
get_auth_token as get_auth_token,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
__all__ = ["AuthError", "get_auth_token"]
|