MCPcopy Index your code
hub / github.com/anomalyco/opencode / runGrep

Function runGrep

packages/opencode/src/cli/cmd/run/tool.ts:301–312  ·  view source on GitHub ↗
(p: ToolProps<typeof GrepTool>)

Source from the content-addressed store, hash-verified

299}
300
301function runGrep(p: ToolProps<typeof GrepTool>): ToolInline {
302 const root = p.input.path ?? ""
303 const title = `Grep "${p.input.pattern ?? ""}"`
304 const suffix = root ? `in ${toolPath(root)}` : ""
305 const matches = p.metadata.matches
306 const description = matches === undefined ? suffix : `${suffix}${suffix ? " · " : ""}${count(matches, "match")}`
307 return {
308 icon: "✱",
309 title,
310 ...(description && { description }),
311 }
312}
313
314function runList(p: ToolProps): ToolInline {
315 const dir = text(dict(p.input).path)

Callers

nothing calls this directly

Calls 2

toolPathFunction · 0.85
countFunction · 0.70

Tested by

no test coverage detected