Using workspace.find for File and Folder Discovery
The workspace.find command is Vex’s primary search tool for locating files and folders in your project. It searches by pattern with optional type filtering and result limits, and it is the foundation of the DISCOVER step in DAP.
Parameters:
pattern(required) — The search pattern. Supports wildcards like*for matching. For example,*Player*.csfinds any C# file with “Player” in the name.path(optional) — The starting directory for the search. Defaults to your project root or the Project Root Preference you set in Dashboard Settings → AI tab.type(optional) — Filter results byfile,folder, orany(the default). Usetype="folder"to find only directories.max_results(optional) — Limit how many results come back. Default is 100, maximum is 500. Keep this reasonable to avoid overwhelming responses.
Aliases:
You can also call this command as find.file, find.folder, or search.workspace. They all do the same thing. Use whichever feels most natural when talking to Vex.
Example searches:
- Find all C# scripts in the project:
workspace.find pattern="*.cs" - Find scripts with “Player” in the name:
workspace.find pattern="*Player*.cs" - Find the Scripts folder:
workspace.find pattern="Scripts" type="folder" - Search within a specific directory:
workspace.find pattern="*.prefab" path="Assets/Prefabs"
Project Root Preference:
In Dashboard Settings → AI tab, you can set a preferred root folder — for example, Assets/Scripts. When set, Vex defaults to searching within this folder for workspace.find operations instead of searching the entire project. A Browse button in the Dashboard opens a folder picker so you do not have to type the path manually. This focuses searches on the part of your project that matters most and reduces noise from unrelated asset folders.
Integration with the discovery gate:
Every time Vex calls workspace.find, the search is recorded as a discovery event in the session history. This satisfies the discovery gate for subsequent file operations on the paths found, so Vex will not receive warnings about skipping the DISCOVER step of DAP.
Why workspace.find matters:
It is the single most important tool for preventing wrong-path errors. Before creating, modifying, or deleting any file, Vex uses workspace.find to understand the current project structure and work with real, verified locations instead of guesses.