Search the app's code for literal text.
POST/ai-builder-api/cli/projects/:projectId/sandbox/search
Finds where text appears in the app's source files (ts, tsx, js, jsx, vue, json, md, css), with dependencies and build output left out. The text is matched literally, not as a pattern. Read the files it finds with POST .../sandbox/view.
Request
The API version.
v3Project identifier.
Possible values: Value must match regular expression ^prj_[A-Za-z0-9]+$
- application/json
- Body
- Example (auto)
Bodyrequired
The text to find, matched literally. It cannot start with '-'.
Possible values: >= 2 characters and <= 200 characters
Folders to search, relative to the workspace root; the whole app when absent.
Possible values: <= 2
Match regardless of case.
The most matching lines to return; 30 by default.
Possible values: >= 1 and <= 60
{
"query": "useCourses",
"paths": [
"apps/clientportal-custom-app"
],
"ignoreCase": false,
"maxResults": 30
}
The matching lines, at most maxResults.
- application/json
- Schema
- Example (auto)
Schema
The text searched for.
The matching lines.
How many lines matched, up to maxResults.
True when more lines matched than were returned.
The folders searched.
{
"query": "useCourses",
"hits": [
{
"path": "apps/clientportal-custom-app/pages/learn.vue",
"line": 12,
"preview": "const { courses } = useCourses()"
}
],
"hitCount": 1,
"truncated": false,
"searchedPaths": [
"."
]
}