search — regex search across files
search runs a regex across the environment’s files and returns matching lines in path:lineno: line format. Supply a glob filter to narrow by filename.
Schema
Section titled “Schema”| Arg | Type | Required | Default | Description |
|---|---|---|---|---|
pattern | string | yes | — | Regex pattern (Python re flavor). |
path | string | no | . | File or directory to search in. |
glob | string | no | null | Glob filter applied to the filename, e.g. *.py. |
Example invocation
Section titled “Example invocation”{"pattern": "class .+Tool\\(BaseTool\\):", "path": "chimera/tools", "glob": "*.py"}from chimera.tools.search import SearchTool
tool = SearchTool()result = tool.execute( {"pattern": "TODO\\(", "path": ".", "glob": "*.md"}, env=local_env,)print(result.output)Output sample
Section titled “Output sample”chimera/tools/bash.py:14: class BashTool(BaseTool):chimera/tools/edit.py:12: class EditFileTool(BaseTool):chimera/tools/git.py:18: class GitTool(BaseTool):An invalid regex returns error="Invalid regex: ..." and an empty output.
See also
Section titled “See also”list_files— directory listing without regex.repo_map— structural map (classes, signatures).import_graph— dependency graph.