Skip to content
Back to skills

Gh Grep

ASecurity

Search real-world code examples across millions of GitHub repositories using grep.app. This skill should be used when looking for implementation patterns, API usage examples, library integration patterns, or production code references. Supports literal code search, regex patterns, and filtering by language/repo/path.

  • 666 stars
  • 0 votes
  • 0 copies
  • 8 views
  • Added February 8, 2026
developmenttypescriptpythongobashreactflaskgitapidocumentation

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill gh-grep --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gh Grep?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gh Grep
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-gh-grep/badge)](https://www.skillsdirectory.com/skills/majiayu000-gh-grep)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gh-grep
description: Search real-world code examples across millions of GitHub repositories using grep.app. This skill should be used when looking for implementation patterns, API usage examples, library integration patterns, or production code references. Supports literal code search, regex patterns, and filtering by language/repo/path.
---

# GitHub Grep

Base directory for this skill: /home/hazeruno/.config/opencode/skills/gh-grep

Search for real-world code examples across over a million public GitHub repositories via grep.app.

## When to Use

- Finding implementation patterns for unfamiliar APIs or libraries
- Looking for correct syntax, parameters, or configuration examples
- Discovering production-ready code examples and best practices
- Understanding how different libraries/frameworks work together

## Quick Start

Run the CLI script with bun (use absolute path):

```bash
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub --query "<code-pattern>" [options]
```

## Core Options

| Option | Description |
|--------|-------------|
| `--query` | Literal code pattern (required) |
| `--match-case` | Case-sensitive search |
| `--match-whole-words` | Match whole words only |
| `--use-regexp` | Interpret query as regex |
| `--repo` | Filter by repository (e.g., `facebook/react`) |
| `--path` | Filter by file path (e.g., `src/components/`) |
| `--language` | Filter by language (comma-separated, e.g., `TypeScript,TSX`) |

## Global Options

- `-t, --timeout <ms>`: Call timeout (default: 30000)
- `-o, --output <format>`: Output format: `text` | `markdown` | `json` | `raw`

## Search Patterns

**Important**: This tool searches for literal code patterns, not keywords.

Good searches:
- `useState(` - Find React useState usage
- `import React from` - Find React import statements
- `async function` - Find async function declarations

Bad searches:
- `react tutorial` - Keywords, not code
- `best practices` - Concepts, not patterns
- `how to use` - Questions, not code

For detailed pattern examples and regex usage, see `references/api_reference.md`.

## Common Examples

```bash
# Find Authentication Patterns
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \
  --query "getServerSession" --language "TypeScript,TSX"

# Find Error Boundary Implementations
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \
  --query "ErrorBoundary" --language "TSX"

# Find useEffect Cleanup with Regex
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \
  --query "(?s)useEffect\(\(\) => {.*removeEventListener" --use-regexp true

# Find CORS Handling in Flask
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \
  --query "CORS(" --match-case true --language "Python"

# Search Within Specific Repository
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \
  --query "createContext" --repo "facebook/react"
```

## Requirements

- [Bun](https://bun.sh) runtime
- `mcporter` package (embedded in script)

## Resources

- `scripts/grep.ts` - Main CLI tool wrapping grep.app MCP server
- `references/api_reference.md` - Detailed parameter documentation and regex patterns

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.