Skip to main content
Search public GitHub repositories without cloning them locally. WarpGrep clones and searches the repo on Morph’s servers — no local clone or ripgrep needed.

Why?

Use GitHub search when your primary agent needs to find code snippets from a public repository that isn’t cloned locally — exploring how an open-source library works, finding usage patterns, or pulling reference implementations. See the GitHub search example.

Direct Usage

import { MorphClient } from '@morphllm/morphsdk';

const morph = new MorphClient({ apiKey: process.env.MORPH_API_KEY });

const result = await morph.warpGrep.searchGitHub({
  query: 'Find authentication middleware',
  github: 'vercel/next.js',       // or full URL: 'https://github.com/vercel/next.js'
  branch: 'canary',               // optional, defaults to repo's default branch
});

if (result.success) {
  for (const ctx of result.contexts) {
    console.log(`${ctx.file}: ${ctx.content}`);
  }
}

As an Agent Tool

Each SDK adapter provides createGitHubSearchTool():
const githubTool = morph.anthropic.createGitHubSearchTool();
// Or: morph.openai.createGitHubSearchTool()
// Or: morph.vercel.createGitHubSearchTool()
Pass githubTool in your tools array the same way as createWarpGrepTool. GitHub search returns the same WarpGrepResult format as codebase search.

Options

createGitHubSearchTool() accepts:
OptionDefaultDescription
morphApiKeyMORPH_API_KEY env varAPI key for Morph
morphApiUrlhttps://api.morphllm.comOverride API base URL
codeSearchUrlhttps://morphllm.comCode storage service URL
timeout30000Timeout in ms