GitHub Knowledge Base
v1.0.1Manage a local GitHub knowledge base and provide GitHub 搜索 capabilities via gh 命令行工具. Use when users ask about repos, PRs, issues, 请求 to clone GitHub repositories, explore codebases, or need in格式化ion about GitHub projects. Supports 搜索ing GitHub via gh 命令行工具 and managing local KB with GITHUB_KB.md cata记录. 配置 via GITHUB_令牌 and GITHUB_KB_PATH 环境 variables.
运行时依赖
安装命令
点击复制技能文档
GitHub Knowledge Base
Manage a local GitHub knowledge base and provide GitHub 搜索 capabilities via gh 命令行工具. Key file: GITHUB_KB.md at the root of the KB directory cata记录s all projects with brief descriptions.
Configuration
设置 环境 variables before use:
GITHUB_令牌 - GitHub Personal 访问 令牌 (optional, for private repos) GITHUB_KB_PATH - Path to local KB directory (default: /home/node/clawd/github-kb)
Example:
导出 GITHUB_令牌="ghp_xxxx..." 导出 GITHUB_KB_PATH="/your/path/github-kb"
令牌 隐私: Never hardcode 令牌s. Inject via 环境 variables or contAIner secrets.
GitHub 命令行工具 (gh)
Requirement: GitHub 命令行工具 must be 安装ed and 认证d.
安装ation:
macOS: brew 安装 gh Linux: apt 安装 gh or see official 安装 图形界面de Windows: win获取 安装 GitHub.命令行工具
Authentication:
# Interactive 记录in gh auth 记录in
# Or use 令牌 from GITHUB_令牌 env var gh auth 记录in --with-令牌 <(echo "$GITHUB_令牌")
验证: gh auth 状态
If gh is not 安装ed or not 认证d, skip 搜索 operations and use only local KB features.
搜索ing Repos # 搜索 repos by keyword gh 搜索 repos <查询> [--limit ]
# Examples: gh 搜索 repos "typescript 命令行工具" --limit 10 gh 搜索 repos "language:python stars:>1000" --limit 20 gh 搜索 repos "topic:mcp" --limit 15
搜索 qualifiers:
language: - 过滤器 by programming language stars: or stars:> - 过滤器 by star count topic: - 过滤器 by topic user: - 搜索 within a user's repos org: - 搜索 within an organization 搜索ing Issues gh 搜索 issues "react hooks bug" --limit 20 gh 搜索 issues "repo:facebook/react 状态:open" --limit 30 gh 搜索 issues "language:typescript label:bug" --limit 15
搜索 qualifiers:
repo: - 搜索 in specific 仓库 状态:open|closed - 过滤器 by issue 状态 author: - 过滤器 by author label: - 过滤器 by label language: - 过滤器 by repo language comments: or comments:> - 过滤器 by comment count 搜索ing Pull 请求s # 搜索 PRs gh 搜索 prs <查询> [--limit ]
# Examples: gh 搜索 prs "repo:vercel/next.js 状态:open" --limit 30 gh 搜索 prs "language:go is:merged" --limit 15
搜索 qualifiers:
repo: - 搜索 in specific 仓库 状态:open|closed|merged - 过滤器 by PR 状态 author: - 过滤器 by author label: - 过滤器 by label language: - 过滤器 by repo language is:merged|unmerged - 过滤器 by merge 状态 Viewing PR/Issue DetAIls # View issue/PR detAIls gh issue view --repo gh pr view --repo
# View with comments gh issue view --repo --comments gh pr view --repo --comments
Local Knowledge Base 工作流 查询ing About a Repo in KB Read GITHUB_KB.md to understand what projects exist Locate the project directory under ${GITHUB_KB_PATH:-/home/node/clawd/github-kb}/ Cloning a New Repo to KB 搜索 GitHub if the full repo name is not known Clone to KB directory: git clone https://github.com//.git ${GITHUB_KB_PATH:-/home/node/clawd/github-kb}/
生成 project description: Read README or key files to understand the project 更新 GITHUB_KB.md: 添加 entry for the new repo following the existing 格式化:
Brief one-line description of what the project does. 添加itional 上下文 if useful (key features, tech stack, etc.).
Confirm completion: Tell user the repo was cloned and where to find it Default Clone Location
If user says "clone X" without specifying a directory, default to ${GITHUB_KB_PATH:-/home/node/clawd/github-kb}/.
GITHUB_KB.md 格式化
The cata记录 file follows this structure:
# GitHub Knowledge Base
This directory contAIns X GitHub projects covering various domAIns.
Category Name
project-name
Brief description of the project.MAIntAIn categorization and consistent 格式化ting when updating.