crewai-cli 1.14.5__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.
Files changed (90) hide show
  1. crewai_cli/__init__.py +1 -0
  2. crewai_cli/add_crew_to_flow.py +73 -0
  3. crewai_cli/authentication/__init__.py +8 -0
  4. crewai_cli/authentication/constants.py +8 -0
  5. crewai_cli/authentication/main.py +60 -0
  6. crewai_cli/authentication/providers/__init__.py +1 -0
  7. crewai_cli/authentication/providers/auth0.py +8 -0
  8. crewai_cli/authentication/providers/base_provider.py +8 -0
  9. crewai_cli/authentication/providers/entra_id.py +8 -0
  10. crewai_cli/authentication/providers/keycloak.py +8 -0
  11. crewai_cli/authentication/providers/okta.py +8 -0
  12. crewai_cli/authentication/providers/workos.py +8 -0
  13. crewai_cli/authentication/token.py +11 -0
  14. crewai_cli/authentication/utils.py +8 -0
  15. crewai_cli/checkpoint_cli.py +732 -0
  16. crewai_cli/checkpoint_tui.py +877 -0
  17. crewai_cli/cli.py +960 -0
  18. crewai_cli/command.py +77 -0
  19. crewai_cli/config.py +30 -0
  20. crewai_cli/constants.py +358 -0
  21. crewai_cli/create_crew.py +321 -0
  22. crewai_cli/create_flow.py +103 -0
  23. crewai_cli/crew_chat.py +23 -0
  24. crewai_cli/deploy/__init__.py +0 -0
  25. crewai_cli/deploy/main.py +308 -0
  26. crewai_cli/deploy/validate.py +845 -0
  27. crewai_cli/enterprise/__init__.py +0 -0
  28. crewai_cli/enterprise/main.py +125 -0
  29. crewai_cli/evaluate_crew.py +41 -0
  30. crewai_cli/git.py +85 -0
  31. crewai_cli/install_crew.py +32 -0
  32. crewai_cli/kickoff_flow.py +23 -0
  33. crewai_cli/memory_tui.py +403 -0
  34. crewai_cli/organization/__init__.py +1 -0
  35. crewai_cli/organization/main.py +107 -0
  36. crewai_cli/plot_flow.py +23 -0
  37. crewai_cli/plus_api.py +12 -0
  38. crewai_cli/provider.py +231 -0
  39. crewai_cli/py.typed +0 -0
  40. crewai_cli/remote_template/__init__.py +0 -0
  41. crewai_cli/remote_template/main.py +250 -0
  42. crewai_cli/replay_from_task.py +34 -0
  43. crewai_cli/reset_memories_command.py +31 -0
  44. crewai_cli/run_crew.py +101 -0
  45. crewai_cli/settings/__init__.py +0 -0
  46. crewai_cli/settings/main.py +110 -0
  47. crewai_cli/shared/__init__.py +0 -0
  48. crewai_cli/shared/token_manager.py +12 -0
  49. crewai_cli/task_outputs.py +67 -0
  50. crewai_cli/templates/AGENTS.md +1017 -0
  51. crewai_cli/templates/__init__.py +0 -0
  52. crewai_cli/templates/crew/.gitignore +3 -0
  53. crewai_cli/templates/crew/README.md +54 -0
  54. crewai_cli/templates/crew/__init__.py +0 -0
  55. crewai_cli/templates/crew/config/agents.yaml +19 -0
  56. crewai_cli/templates/crew/config/tasks.yaml +17 -0
  57. crewai_cli/templates/crew/crew.py +63 -0
  58. crewai_cli/templates/crew/knowledge/user_preference.txt +4 -0
  59. crewai_cli/templates/crew/main.py +94 -0
  60. crewai_cli/templates/crew/pyproject.toml +24 -0
  61. crewai_cli/templates/crew/tools/__init__.py +0 -0
  62. crewai_cli/templates/crew/tools/custom_tool.py +19 -0
  63. crewai_cli/templates/flow/.gitignore +4 -0
  64. crewai_cli/templates/flow/README.md +56 -0
  65. crewai_cli/templates/flow/__init__.py +0 -0
  66. crewai_cli/templates/flow/crews/content_crew/config/agents.yaml +33 -0
  67. crewai_cli/templates/flow/crews/content_crew/config/tasks.yaml +50 -0
  68. crewai_cli/templates/flow/crews/content_crew/content_crew.py +75 -0
  69. crewai_cli/templates/flow/main.py +92 -0
  70. crewai_cli/templates/flow/pyproject.toml +22 -0
  71. crewai_cli/templates/flow/tools/__init__.py +0 -0
  72. crewai_cli/templates/flow/tools/custom_tool.py +21 -0
  73. crewai_cli/templates/tool/.gitignore +10 -0
  74. crewai_cli/templates/tool/README.md +48 -0
  75. crewai_cli/templates/tool/pyproject.toml +12 -0
  76. crewai_cli/templates/tool/src/{{folder_name}}/__init__.py +3 -0
  77. crewai_cli/templates/tool/src/{{folder_name}}/tool.py +10 -0
  78. crewai_cli/tools/__init__.py +0 -0
  79. crewai_cli/tools/main.py +364 -0
  80. crewai_cli/train_crew.py +32 -0
  81. crewai_cli/triggers/__init__.py +6 -0
  82. crewai_cli/triggers/main.py +137 -0
  83. crewai_cli/update_crew.py +122 -0
  84. crewai_cli/user_data.py +22 -0
  85. crewai_cli/utils.py +137 -0
  86. crewai_cli/version.py +24 -0
  87. crewai_cli-1.14.5.dist-info/METADATA +53 -0
  88. crewai_cli-1.14.5.dist-info/RECORD +90 -0
  89. crewai_cli-1.14.5.dist-info/WHEEL +4 -0
  90. crewai_cli-1.14.5.dist-info/entry_points.txt +2 -0
crewai_cli/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "1.14.5"
@@ -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,8 @@
1
+ """CLI authentication entry point."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_cli.authentication.main import AuthenticationCommand
6
+
7
+
8
+ __all__ = ["AuthenticationCommand"]
@@ -0,0 +1,8 @@
1
+ """Re-export of authentication constants from ``crewai_core.auth.constants``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.constants import ALGORITHMS as ALGORITHMS
6
+
7
+
8
+ __all__ = ["ALGORITHMS"]
@@ -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,8 @@
1
+ """Re-export of ``Auth0Provider`` from ``crewai_core.auth.providers.auth0``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.providers.auth0 import Auth0Provider as Auth0Provider
6
+
7
+
8
+ __all__ = ["Auth0Provider"]
@@ -0,0 +1,8 @@
1
+ """Re-export of ``BaseProvider`` from ``crewai_core.auth.providers.base_provider``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.providers.base_provider import BaseProvider as BaseProvider
6
+
7
+
8
+ __all__ = ["BaseProvider"]
@@ -0,0 +1,8 @@
1
+ """Re-export of ``EntraIdProvider`` from ``crewai_core.auth.providers.entra_id``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.providers.entra_id import EntraIdProvider as EntraIdProvider
6
+
7
+
8
+ __all__ = ["EntraIdProvider"]
@@ -0,0 +1,8 @@
1
+ """Re-export of ``KeycloakProvider`` from ``crewai_core.auth.providers.keycloak``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.providers.keycloak import KeycloakProvider as KeycloakProvider
6
+
7
+
8
+ __all__ = ["KeycloakProvider"]
@@ -0,0 +1,8 @@
1
+ """Re-export of ``OktaProvider`` from ``crewai_core.auth.providers.okta``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.providers.okta import OktaProvider as OktaProvider
6
+
7
+
8
+ __all__ = ["OktaProvider"]
@@ -0,0 +1,8 @@
1
+ """Re-export of ``WorkosProvider`` from ``crewai_core.auth.providers.workos``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.providers.workos import WorkosProvider as WorkosProvider
6
+
7
+
8
+ __all__ = ["WorkosProvider"]
@@ -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"]
@@ -0,0 +1,8 @@
1
+ """Re-export of ``validate_jwt_token`` from ``crewai_core.auth.utils``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from crewai_core.auth.utils import validate_jwt_token as validate_jwt_token
6
+
7
+
8
+ __all__ = ["validate_jwt_token"]