[`agentic_crew.tools.file_tools`](#module-agentic_crew.tools.file_tools)
File manipulation tools for CrewAI agents.
These tools enable agents to read and write code to specific directories in game package codebases (e.g., packages/otterfall).
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”WriteFileInput | Input schema for GameCodeWriterTool. |
|---|---|
GameCodeWriterTool | Tool for writing code files to a game package codebase. |
ReadFileInput | Input schema for GameCodeReaderTool. |
GameCodeReaderTool | Tool for reading code files from a game package codebase. |
ListDirInput | Input schema for DirectoryListTool. |
DirectoryListTool | Tool for listing files in a directory. |
Functions
Section titled “Functions”_find_workspace_root | Search upward for workspace root (contains pyproject.toml with workspace). |
|---|---|
get_workspace_root | Get the workspace root directory for the target game code package. |
ALLOWED_WRITE_DIRS | |
|---|---|
ALLOWED_EXTENSIONS |
agentic_crew.tools.file_tools._find_workspace_root() → pathlib.Path | None
Section titled “agentic_crew.tools.file_tools._find_workspace_root() → pathlib.Path | None”Search upward for workspace root (contains pyproject.toml with workspace).
agentic_crew.tools.file_tools.get_workspace_root(package_name: str | None = None) → pathlib.Path
Section titled “agentic_crew.tools.file_tools.get_workspace_root(package_name: str | None = None) → pathlib.Path”Get the workspace root directory for the target game code package.
Returns packages/<package_name> as the workspace root, where the game code lives.
Uses marker file search to find workspace root reliably, regardless of where this module is installed or imported from.
Args: package_name: Name of the target package. If not provided, uses TARGET_PACKAGE environment variable, or defaults to “otterfall”.
Returns: Path to packages/<package_name> directory.
agentic_crew.tools.file_tools.ALLOWED_WRITE_DIRS
Section titled “agentic_crew.tools.file_tools.ALLOWED_WRITE_DIRS”[‘src/ecs’, ‘src/ecs/data’, ‘src/ecs/systems’, ‘src/components’, ‘src/components/ui’, ‘src/stores’, …
agentic_crew.tools.file_tools.ALLOWED_EXTENSIONS
Section titled “agentic_crew.tools.file_tools.ALLOWED_EXTENSIONS”None
class agentic_crew.tools.file_tools.WriteFileInput
Section titled “class agentic_crew.tools.file_tools.WriteFileInput”Bases: pydantic.BaseModel
Input schema for GameCodeWriterTool.
file_path : str
Section titled “file_path : str”‘Field(…)’
content : str
Section titled “content : str”‘Field(…)’
class agentic_crew.tools.file_tools.GameCodeWriterTool
Section titled “class agentic_crew.tools.file_tools.GameCodeWriterTool”Bases: crewai.tools.BaseTool
Tool for writing code files to a game package codebase.
This tool is restricted to specific directories to ensure agents only modify appropriate parts of the codebase.
‘Write Game Code File’
description : str =
Section titled “description : str = ”args_schema : type[pydantic.BaseModel]
Section titled “args_schema : type[pydantic.BaseModel]”None
_run(file_path: str, content: str) → str
Section titled “_run(file_path: str, content: str) → str”Write the file content to the specified path.
class agentic_crew.tools.file_tools.ReadFileInput
Section titled “class agentic_crew.tools.file_tools.ReadFileInput”Bases: pydantic.BaseModel
Input schema for GameCodeReaderTool.
file_path : str
Section titled “file_path : str”‘Field(…)’
class agentic_crew.tools.file_tools.GameCodeReaderTool
Section titled “class agentic_crew.tools.file_tools.GameCodeReaderTool”Bases: crewai.tools.BaseTool
Tool for reading code files from a game package codebase.
Use this to understand existing patterns before writing new code.
‘Read Game Code File’
description : str =
Section titled “description : str = ”args_schema : type[pydantic.BaseModel]
Section titled “args_schema : type[pydantic.BaseModel]”None
_run(file_path: str) → str
Section titled “_run(file_path: str) → str”Read the file content from the specified path.
class agentic_crew.tools.file_tools.ListDirInput
Section titled “class agentic_crew.tools.file_tools.ListDirInput”Bases: pydantic.BaseModel
Input schema for DirectoryListTool.
directory : str
Section titled “directory : str”‘Field(…)’
class agentic_crew.tools.file_tools.DirectoryListTool
Section titled “class agentic_crew.tools.file_tools.DirectoryListTool”Bases: crewai.tools.BaseTool
Tool for listing files in a directory.
Use this to discover existing files and understand project structure.
‘List Directory Contents’
description : str =
Section titled “description : str = ”args_schema : type[pydantic.BaseModel]
Section titled “args_schema : type[pydantic.BaseModel]”None
_run(directory: str) → str
Section titled “_run(directory: str) → str”List directory contents.