Ask Github
GitHub repository management plugin for OpenCode - auto-clone repos and analyze with AI
1
35
近 7 天 5
31.6
生态多维模型
13 天前
2026-09-21
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-ask-github@1.0.2"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-ask-github@1.0.2"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-ask-githubOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
GitHub repository exploration plugin for OpenCode. Clones repositories on-demand and delegates analysis to AI subagents.
Features
- Auto-clone: Repositories are cloned on-demand with shallow clone for speed
- AI Analysis: Delegates to the
exploresubagent for codebase analysis - Aliases: Configure shortcuts for frequently used repositories
- Cache Management: List and remove cloned repositories
Installation
Install via npm/bun:
bunx opencode-ask-github
# or
npx opencode-ask-github
Or add manually to your OpenCode configuration (~/.config/opencode/config.json):
{
"plugins": ["opencode-ask-github"]
}
Commands
/gh-ask <repo> [question]
Clone/locate a repository and analyze it with AI.
/gh-ask sveltejs/svelte how is the component compiler structured?
/gh-ask https://github.com/tailwindlabs/tailwindcss what's the CLI architecture?
/gh-ask sv explain the reactivity system
The command runs the same repository preparation as the gh-ask tool directly, then submits the tool result as a new user message. Any question after the repository argument is included after the result. Repository preparation completes before the model runs.
Supported input formats:
- GitHub URLs:
https://github.com/owner/repo - owner/repo pairs:
sveltejs/svelte - Aliases:
sv(if configured)
/gh-list
List all cloned repositories and configured aliases.
/gh-remove <repo>
Remove a cloned repository from the cache.
AI Tool
The plugin provides a single tool for the AI:
| Tool | Description |
|---|---|
gh-ask |
Prepare a GitHub repo for exploration (clone/update). Returns the local path and suggests a subagent for analysis. |
The AI can call this tool directly when it needs to explore a repository, even without the /gh-ask command.
Configuration
Configuration is stored in ~/.config/opencode/ask-github.json.
Aliases
Add aliases for frequently used repositories by editing the config file directly:
{
"aliases": {
"sv": "sveltejs/svelte",
"tw": "tailwindlabs/tailwindcss"
}
}
You can also use /gh-list to see all configured aliases.
Prompt
Customize which subagent is suggested for repository exploration:
{
"prompt": {
"agent": "general"
}
}
Default agent is explore.
Storage
Repositories are cloned to ~/.cache/opencode-github/{owner}/{repo}/.
License
MIT
同类生态推荐
Llm Proxy
opencode-llm-proxy
Local AI gateway for OpenCode with tool/function calling — use any model via OpenAI, Anthropic, or Gemini API format
Forge Session Title
opencode-forge-session-title
OpenCode plugin that prefixes session titles with forge issue/PR/MR references (GitHub & GitLab)
Pr Tracker
@kitlangton/opencode-pr-tracker
Session-aware pull request tracking for the OpenCode V2 TUI