Loading...
Loading...
Search GitHub code across millions of repositories using grep.app. Use when you need to find code patterns, implementations, examples, or understand how features are built in public codebases. (project)
npx skill4agent add jaredpalmer/claude-plugins github-code-searchclaude mcp add --transport http grep https://mcp.grep.app/mcpgrepbunnpx tsxbun run skills/github-code-search/scripts/search.ts "query" [--lang=Language] [--repo=owner/repo] [--limit=N] [--regexp]# Search for "use cache" in TypeScript files
bun run skills/github-code-search/scripts/search.ts "use cache" --lang=TypeScript --limit=5
# Search in a specific repository
bun run skills/github-code-search/scripts/search.ts "cacheLife" --repo=vercel/next.js --limit=10
# Use regex patterns
bun run skills/github-code-search/scripts/search.ts "async.*await" --regexp --lang=TypeScript{
"query": "cacheLife",
"options": { "language": "TypeScript", "limit": 3 },
"total": 2931,
"results": [
{
"repo": "vercel/next.js",
"path": "packages/next/src/server/use-cache/cache-life.ts",
"url": "https://github.com/vercel/next.js/blob/canary/packages/next/src/server/use-cache/cache-life.ts",
"matches": [{ "lineNumber": 5, "content": "export type »CacheLife« = {" }]
}
]
}»«// Execute with: bun -e "..."
const response = await fetch(
'https://grep.app/api/search?q=useOptimistic&l=TypeScript'
)
const data = await response.json()
// Process results locally - this is the efficiency gain!
const filtered = data.hits.hits
.filter((hit: any) => hit.repo.includes('react'))
.slice(0, 5)
.map((hit: any) => ({ repo: hit.repo, path: hit.path }))
console.log(JSON.stringify(filtered, null, 2))curl -s "https://grep.app/api/search?q=useOptimistic+hook&l=TypeScript" | jq '.hits.hits[:5] | .[] | {repo: .repo.raw, path: .path.raw}'| Parameter | Description | Example |
|---|---|---|
| Search query (required). Supports regex with | |
| Language filter | |
| Repository filter | |
| Enable regex mode | |
curl -s "https://grep.app/api/search?q=%22use%20cache%22&l=TypeScript" | jq '.hits.hits[:10] | .[] | {repo: .repo.raw, path: .path.raw}'curl -s "https://grep.app/api/search?q=catch.*error.*log®exp=true&l=TypeScript" | jq '.hits.total'curl -s "https://grep.app/api/search?q=cacheLife&r=vercel/next.js" | jq '.hits.hits[] | {path: .path.raw, lines: .content.lines}'regexp=true// Via MCP (if mcp__grep__search is available)
mcp__grep__search({
query: 'authentication middleware',
language: 'TypeScript',
useRegexp: false,
})