Skip to content

Expert-Vision-Software/opencode-intellisearch

Repository files navigation

intellisearch

GitHub repository search for OpenCode with automatic DeepWiki integration for technical answers.

✨ Features

  • GitHub-First Search: Searches for GitHub repositories and extracts technical answers directly from code
  • DeepWiki Integration: Uses DeepWiki for authoritative Q&A on any GitHub repository
  • Automatic Repo Detection: Identifies GitHub repos from search results and maps them to owner/repo format
  • Simple Workflow: Search web → Extract GitHub repos → Query DeepWiki → Return results
  • Cross-Platform: Works on Windows, macOS, and Linux
  • TypeScript + ESM: Built with TypeScript for type safety, uses ESM for OpenCode plugin compatibility
  • Bun-Native: Zero build step, runs TypeScript natively with Bun

🚀 Installation

Add to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["opencode-intellisearch"]
}

Or install locally in your project:

bun add -d opencode-intellisearch

Then add to your project's opencode.json:

{
  "plugins": ["opencode-intellisearch"]
}

📖 Usage

Once installed, the plugin automatically adds the /search-intelligently command to OpenCode:

/search-intelligently How does React useEffect work?
/search-intelligently Tools for validating semver specification strings
/search-intelligently Best way to handle file uploads in Next.js
/search-intelligently Compare Zod vs Yup for validation libraries
/search-intelligently github:vercel/next.js app router patterns

🔧 Requirements

Runtime

Optional

  • GitHub CLI (gh) - Direct GitHub repository search (preferred when available)
    • Install from cli.github.com
    • Run gh auth login to authenticate
    • To opt out: deny gh tool permission in OpenCode

MCP Servers

Required:

  • deepwiki - Repository Q&A (docs)

Setup MCP Servers

Configure in ~/.config/opencode/opencode.json or project opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcpServers": {
    "deepwiki": {
      "url": "https://mcp.deepwiki.com/mcp"
    }
  }
}

🧠 How It Works

Tool Priority

  1. GitHub CLI (if authenticated) → Direct GitHub API search with topics/language
  2. Search Tool (websearch, etc.) → Web search with site:github.com operator
  3. Fetch Tool (webfetch) → URI-based search with engine cycling (Brave → DDG → Google)

Simple Linear Workflow

  1. Detect Tools → Check gh CLI, search tool, or fetch tool availability
  2. Search Repositories → Use best available method to find GitHub repositories
  3. Extract Repositories → Map results to owner/repo format (skip if gh CLI used)
  4. Query DeepWiki → Ask questions about detected repositories
  5. Return Results → Present authoritative answers from repository documentation and code

📚 Documentation

🐛 Troubleshooting

Installation Issues

"bun command not found" - Bun is not installed:

  • Install Bun from bun.sh:
    curl -fsSL https://bun.sh/install | bash

Plugin not loading:

  • Check OpenCode logs: ~/.local/share/opencode/log/
  • Verify plugin is in opencode.json plugins array
  • Ensure Bun is installed and in PATH

Search Issues

"deepWiki unavailable" - Falling back to webfetch:

  • Verify deepWiki MCP server is configured in opencode.json
  • Check MCP server status with /mcp status

All tools failed:

  • Try rephrasing your query
  • Check MCP server status with /mcp status
  • Verify internet connectivity

🗑️ Uninstall

Remove from opencode.json plugins array:

{
  "plugins": []
}

Or for local installs:

bun remove opencode-intellisearch

🛠️ Development

# Install dependencies
bun install

# Type check
bun run check

# Run unit tests
bun test

# Link for local testing
bun link

E2E Testing

The plugin includes comprehensive E2E tests using the OpenCode SDK:

# Quick test (explicit mode, 1 run)
bun test:e2e

# Multiple runs for metrics
bun test:e2e --runs 3

# Test both skill loading modes
bun test:e2e --mode both

# Set baseline after changes
bun test:e2e --set-baseline

See CONTRIBUTING.md for detailed testing instructions.

📄 License

MIT License - see LICENSE

🤝 Contributing

Contributions welcome! See CONTRIBUTING.md

🙏 Acknowledgments

Built with:

  • DeepWiki - Repository intelligence
  • OpenCode - AI coding environment
  • Bun - Fast JavaScript runtime

About

Intelligent web search routing for OpenCode with automatic tool selection, graceful fallbacks, and memory caching.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors