Search source text at an exact identity
code_grepFinds a literal string (no regular expressions) in the text files of a public GitHub repository at a commit sha or an npm package version, and returns the matches with path, line number, line text and the file's git blob id. A hit is a proven match in the exact bytes named. Counts of files scanned, binary files (a NUL byte or invalid UTF-8; never searched as text) and files over the per-file memory bound are reported, so nothing is silently left out. Pages with offset/limit: at most 1000 matches and about 1 MB per page (truncated:true when the byte bound ended a page); next_offset names the next page. Every answer, an error included, carries a pauhu-library-receipt/2 in structuredContent.receipt and as a trailing "receipt: {...}" text line; library_verify checks a receipt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or 40-hex commit sha (default HEAD). It is resolved to a commit sha first; the read is at that sha. | |
| path | No | Only files under this directory prefix | |
| repo | No | GitHub repository as owner/name, e.g. nodejs/node. Give this or package. | |
| limit | No | Matches per page (default 200, at most 1000) | |
| query | Yes | Literal text to find | |
| offset | No | ||
| package | No | npm package name, e.g. source-map-js or @scope/name. Give this or repo. | |
| version | No | npm version or dist-tag (default latest); the tarball is checked against the registry's sha512 integrity. | |
| extensions | No | Only files ending in one of these, e.g. [".ts", ".js"] | |
| ignore_case | No |