grep-app-cli
Search code across 1M+ public GitHub repos via grep.app.
code
grep-app-cli [OPTIONS] <QUERY>
Options
| Flag | Description |
|---|---|
--match-case | Case sensitive search |
--match-whole-words | Match whole words only |
--use-regexp | Interpret query as a regular expression |
--repo <REPO> | Filter by repository (e.g., facebook/react) |
--path <PATH> | Filter by file path (e.g., src/components/) |
--language <LANG> | Filter by language (repeatable) |
--json | Output structured JSON |
Translating Questions to Queries
Think about what the code literally looks like, then search for that string.
| Question | Command |
|---|---|
| How do devs handle auth in Next.js? | grep-app-cli --language TypeScript 'getServerSession' |
| Common error boundary patterns? | grep-app-cli --language TSX 'ErrorBoundary' |
| Real useEffect cleanup examples? | grep-app-cli --use-regexp '(?s)useEffect\(\(\) => {.*removeEventListener' |
| How is CORS handled in Flask? | grep-app-cli --match-case --language Python 'CORS(' |
| Go HTTP handler implementations? | grep-app-cli --use-regexp --match-case --language Go 'func\s+\(.*\)\s+ServeHTTP' |
| Usage of createContext in React repo? | grep-app-cli --repo facebook/react 'createContext' |
Best Practices
- •Include surrounding syntax — search
useState(notuseStateto disambiguate calls from docs. - •Start specific, then broaden — begin with
--language/--repofilters, remove if too few results. - •Use
--use-regexpwith(?s)prefix for multi-line matching (e.g.,'(?s)impl\s+Display\s+for'). - •Results are capped at 10 — use filters to ensure relevance.
- •Use
--jsonfor programmatic consumption; default output has terminal syntax highlighting. - •Language names:
TypeScript,JavaScript,TSX,JSX,Go,Rust,Python,Java, etc.