When building DSH-based agents or tool flows, models are often limited to the current workspace or must manually run external commands to retrieve files. This leads to low search efficiency and a high syntax barrier. To solve this issue, you can use a file search tool based on the voidtools Everything engine.
This plugin provides DSH models with a tool named everything_search, leveraging Everything’s NTFS index to perform millisecond-scale full-file retrieval on Windows. It supports the full Everything search syntax and allows the model to directly obtain file metadata without developers writing complex scripts.
Prerequisites¶
Before using this plugin, the following environment requirements must be met:
- Operating System: Only Windows is supported (based on NTFS volumes).
- Software Dependency: The Everything software must be installed and running.
- Command-Line Tool:
es.exe(the Everything command-line client) must be available in the system PATH environment variable.
Verify that the environment is ready:
es -h
If help information is returned, the environment is configured correctly.
Installation and Enablement¶
Install it through DSH’s plugin manager:
dsh plugin --profile web add "github:zhourenke/dsh-tool-everything"
After installation, restart the DSH process, and the model can invoke the everything_search tool.
Core Features¶
This tool provides the following capabilities:
- Full-Disk Search: Based on the Everything index, not limited to the current workspace, supports millisecond-scale search.
- Full-Text Search: Supports
content:syntax to search files by file content, but the path must be specified. - Metadata Return: Supports returning information such as file size, creation/modification/access time, extension, and attributes.
- Complete Syntax: Supports Everything syntax such as wildcards, Boolean operations, and regular expressions.
- Result Counting: Automatically fills in the
totalfield and returns the total number of matches. - Fast Lookups: Searches based on the index rather than directory scanning, with extremely fast response times.
Typical Usage¶
When the model invokes the tool, it can directly use the syntax above. The following are several typical scenarios:
-
Find files larger than 1GB on the D drive:
query: size:>1gb, path: D:\ -
Find text files containing the keyword
TODOunder theC:\Projectsdirectory:
query: content:TODO, path: C:\Projects -
Find all PDF files modified in July 2024:
query: *.pdf dm:2024-07-01..2024-07-31
Caveats and Limitations¶
When using this feature, note the following:
- Path Scoping: When using
content:full-text search, you must explicitly limit the search scope with thepathparameter; otherwise, it may be rejected or automatically narrowed. - Hard Link Issue: Hard-linked files may not be found (this is a characteristic of Everything’s real-time index). You need to run Force Rebuild in Everything.
- Syntax Limitations: Regular expression patterns do not support
(...)grouping; inlinepath:syntax does not support paths containing spaces. - Result Markers: In search results, folders end with
\; files without an extension return an empty extension string.
Summary¶
zhourenke/dsh-tool-everything is suitable for scenarios requiring deep and fast file retrieval in a local Windows environment. It encapsulates Everything’s powerful indexing capability as a DSH tool, lowering the barrier for models to invoke the file system. For more details, refer to the plugin directory or GitHub repository.