mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-09-20 10:03:37 +00:00
docs(cli): guide assistants to platform tools
This commit is contained in:
@@ -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:<app>` 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
|
||||
|
||||
7
lib/cli/src/crewai_cli/templates/CURSOR.md
Normal file
7
lib/cli/src/crewai_cli/templates/CURSOR.md
Normal file
@@ -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
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user