From aecdbfc7d785ca4ced81930d3a227fde7b4eeea8 Mon Sep 17 00:00:00 2001 From: ViditOstwal Date: Fri, 18 Sep 2026 19:30:00 +0530 Subject: [PATCH] docs(cli): guide assistants to platform tools --- lib/cli/src/crewai_cli/templates/AGENTS.md | 35 ++++++++++++++++++++++ lib/cli/src/crewai_cli/templates/CURSOR.md | 7 +++++ lib/cli/src/crewai_cli/utils.py | 4 +-- lib/cli/tests/test_create_crew.py | 4 +++ lib/cli/tests/test_create_flow.py | 2 ++ lib/cli/tests/tools/test_main.py | 2 ++ 6 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 lib/cli/src/crewai_cli/templates/CURSOR.md diff --git a/lib/cli/src/crewai_cli/templates/AGENTS.md b/lib/cli/src/crewai_cli/templates/AGENTS.md index 534fa21d7..313a1befb 100644 --- a/lib/cli/src/crewai_cli/templates/AGENTS.md +++ b/lib/cli/src/crewai_cli/templates/AGENTS.md @@ -854,6 +854,41 @@ flow.plot("my_flow") # Generates my_flow.html ## Custom Tools +### CrewAI Platform Tools +CrewAI AMP provides integrations for supported applications, exposing the actions +available through each connected application as CrewAI tools. Before selecting an +integration, use your file-read or search tools to read the installed +`crewai_core/platform_apps.py` module. Its `PLATFORM_APPS` catalog is the source +of truth for supported application selectors; do not hard-code that list. +For how to connect applications and use their actions in AMP, see +[CrewAI Platform Tools and Integrations](https://docs-platform.crewai.com/platform/en/features/tools-and-integrations). + +Connect the required application in CrewAI AMP before using it. Then pass its +selector to `CrewaiPlatformTools`; the factory returns the action tools available +for that application, which can be assigned directly to an agent: + +```python +from crewai_tools import CrewaiPlatformTools + +gmail_tools = CrewaiPlatformTools(apps=["gmail"]) +agent = Agent(..., tools=gmail_tools) +``` + +Multiple connected applications can be requested together: + +```python +platform_tools = CrewaiPlatformTools(apps=["gmail", "slack"]) +``` + +In JSON crew projects, use the equivalent `platform:` selector in the +agent's `tools` list: +```jsonc +{ "tools": ["platform:gmail"] } +``` + +If an application or action is not listed in `PLATFORM_APPS`, do not invent a +selector; use an appropriate built-in or custom tool instead. + ### Using BaseTool ```python from typing import Type diff --git a/lib/cli/src/crewai_cli/templates/CURSOR.md b/lib/cli/src/crewai_cli/templates/CURSOR.md new file mode 100644 index 000000000..3da258b14 --- /dev/null +++ b/lib/cli/src/crewai_cli/templates/CURSOR.md @@ -0,0 +1,7 @@ +# CURSOR.md + +Cursor loads this file for project guidance. The import below pulls in the shared +CrewAI instructions. Keep shared conventions in `AGENTS.md`; add Cursor-specific +notes under the import. + +@AGENTS.md diff --git a/lib/cli/src/crewai_cli/utils.py b/lib/cli/src/crewai_cli/utils.py index 4ce11994a..517293fab 100644 --- a/lib/cli/src/crewai_cli/utils.py +++ b/lib/cli/src/crewai_cli/utils.py @@ -101,8 +101,8 @@ _TEMPLATES_DIR = Path(__file__).parent / "templates" def copy_assistant_imports(destination: Path) -> None: - """Copy the ``CLAUDE.md`` and ``GEMINI.md`` that import ``AGENTS.md``.""" - for name in ("CLAUDE.md", "GEMINI.md"): + """Copy assistant instruction files that import ``AGENTS.md``.""" + for name in ("CLAUDE.md", "CURSOR.md", "GEMINI.md"): shutil.copy2(_TEMPLATES_DIR / name, destination / name) diff --git a/lib/cli/tests/test_create_crew.py b/lib/cli/tests/test_create_crew.py index fb16fb053..6407ae59d 100644 --- a/lib/cli/tests/test_create_crew.py +++ b/lib/cli/tests/test_create_crew.py @@ -1148,6 +1148,8 @@ def test_create_crew_scaffolds_assistant_instructions(tmp_path, monkeypatch): assert "CrewAI Reference for AI Coding Assistants" in agents_md claude_md = (project_root / "CLAUDE.md").read_text(encoding="utf-8") assert "@AGENTS.md" in claude_md.splitlines() + cursor_md = (project_root / "CURSOR.md").read_text(encoding="utf-8") + assert "@AGENTS.md" in cursor_md.splitlines() gemini_md = (project_root / "GEMINI.md").read_text(encoding="utf-8") assert "@./AGENTS.md" in gemini_md.splitlines() @@ -1207,5 +1209,7 @@ def test_json_create_scaffolds_assistant_instructions(tmp_path, monkeypatch): assert "crew.jsonc" in agents_md claude_md = (project_root / "CLAUDE.md").read_text(encoding="utf-8") assert "@AGENTS.md" in claude_md.splitlines() + cursor_md = (project_root / "CURSOR.md").read_text(encoding="utf-8") + assert "@AGENTS.md" in cursor_md.splitlines() gemini_md = (project_root / "GEMINI.md").read_text(encoding="utf-8") assert "@./AGENTS.md" in gemini_md.splitlines() diff --git a/lib/cli/tests/test_create_flow.py b/lib/cli/tests/test_create_flow.py index 549b98993..2ec1699ff 100644 --- a/lib/cli/tests/test_create_flow.py +++ b/lib/cli/tests/test_create_flow.py @@ -39,6 +39,8 @@ def test_create_flow_declarative_project_can_run( assert "human_feedback" not in agents_md claude_md = (project_root / "CLAUDE.md").read_text(encoding="utf-8") assert "@AGENTS.md" in claude_md.splitlines() + cursor_md = (project_root / "CURSOR.md").read_text(encoding="utf-8") + assert "@AGENTS.md" in cursor_md.splitlines() gemini_md = (project_root / "GEMINI.md").read_text(encoding="utf-8") assert "@./AGENTS.md" in gemini_md.splitlines() diff --git a/lib/cli/tests/tools/test_main.py b/lib/cli/tests/tools/test_main.py index 8ec9cd43f..ee8591f9d 100644 --- a/lib/cli/tests/tools/test_main.py +++ b/lib/cli/tests/tools/test_main.py @@ -75,6 +75,8 @@ def test_create_scaffolds_assistant_instructions(mock_subprocess, tool_command): assert "Never disable, block, or silence CrewAI's built-in observability" in agents_md claude_md = Path("test_tool", "CLAUDE.md").read_text(encoding="utf-8") assert "@AGENTS.md" in claude_md.splitlines() + cursor_md = Path("test_tool", "CURSOR.md").read_text(encoding="utf-8") + assert "@AGENTS.md" in cursor_md.splitlines() gemini_md = Path("test_tool", "GEMINI.md").read_text(encoding="utf-8") assert "@./AGENTS.md" in gemini_md.splitlines()