Agens github-code-search
Search code across GitHub repositories using advanced search queries
install
source · Clone the upstream repo
git clone https://github.com/Gyoungwe/agens
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Gyoungwe/agens "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/github-code-search" ~/.claude/skills/gyoungwe-agens-github-code-search && rm -rf "$T"
manifest:
skills/github-code-search/SKILL.mdsource content
GitHub Code Search
Search code across GitHub repositories using the GitHub API with PyGithub library.
Prerequisites
pip install PyGithub
Usage
When user asks to search GitHub code, use the
search_github_code function with:
: Search query (e.g., "function_name")query
: Optional programming language filter (python, javascript, typescript, etc.)language
: Maximum number of results (default: 10)max_results
: Optional specific repository to search (format: "owner/repo")repo
Examples
Search for "authentication" in GitHub code Find "useState" hook usage across React repositories Search for "def main" in Python files Search within a specific repo: repo:facebook/react useState
Authentication
GitHub code search API requires authentication. Set your token:
export GITHUB_TOKEN="ghp_xxxx"
Get a token at: https://github.com/settings/tokens (needs 'repo' scope)
Features
- Search across all of GitHub or specific repositories
- Filter by language
- View file content and line numbers
- See repository context for each result
- Supports advanced GitHub search syntax