gptme-warpgrep

Agentic code search plugin for gptme using [Morph's warp-grep](https://docs.morphllm.com/sdk/components/warp-grep/direct). plugins/gptme-warpgrep View on GitHub

gptme-warpgrep

Agentic code search plugin for gptme using Morph's warp-grep.

Overview

Warp Grep is an AI-powered code search tool that intelligently explores codebases over multiple turns (up to 4) until it finds the relevant code for your query.

Unlike simple grep, it:

Installation

# Install the plugin
pip install -e plugins/gptme-warpgrep

# Or with uv
uv pip install -e plugins/gptme-warpgrep

Configuration

Set your Morph API key:

export MORPH_API_KEY="your-api-key"

Get an API key at morphllm.com/dashboard.

Usage

In gptme

Add to your gptme.toml (user or project level):

[plugins]
paths = ["path/to/gptme-contrib/plugins"]
enabled = ["gptme_warp_grep"]  # Optional: limit which plugins load

Then use in conversations:

# Search for specific code patterns
warp_grep("Find authentication middleware")

# Search in a specific repo
warp_grep("Find all API endpoints", "/path/to/project")

# Conceptual queries work too
warp_grep("How are database errors handled?")

As a library

from gptme_warp_grep import warp_grep_search

# Returns list of ResolvedFile objects
results = warp_grep_search(
    query="Find where JWT tokens are validated",
    repo_root="/path/to/project",
)

for file in results:
    print(f"=== {file.path} ===")
    print(file.content)

How it Works

  1. Query Analysis: The model classifies your query (specific/conceptual/exploratory)
  2. Strategic Search: Uses parallel grep, analyse, and read operations
  3. Iterative Refinement: Up to 4 turns of searching and narrowing down
  4. Context Extraction: Returns relevant code snippets with line numbers

Available Tools (used internally)

Requirements

License

MIT