You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exclude_patterns: Annotated[List[str], "Glob patterns to exclude"] =None,
502
+
sort_by: Annotated[Literal["path", "modified", "size"], "Sort by path, modified or size"] ="path",
503
+
max_results: int=200,
502
504
) ->str:
503
505
"""
504
506
Recursively search for files and directories matching a pattern. The patterns should be glob-style patterns that match paths relative to the working directory.
505
507
Use pattern like '.ext' to match files in current directory, and '**/.ext' to match files in all subdirectories.
506
508
Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.
509
+
If no path is provided, searches in the first allowed directory.
507
510
"""
511
+
ifnotpath:
512
+
path=get_allowed_directories()[0]
508
513
valid_path=_validate_path(path)
509
514
results= []
510
515
ifexclude_patternsisNone:
@@ -533,6 +538,16 @@ def search_files(
533
538
exceptExceptionase:
534
539
raiseRuntimeError(f"Error searching files in {valid_path}: {e}") frome
0 commit comments