A complete WarpGrep implementation in Python. No SDK needed — just openai and ripgrep.
This is the same protocol that the TypeScript SDK uses under the hood. Use this as a reference for building WarpGrep integrations in any language.
- Python 3.10+
- ripgrep installed (
brew install ripgrep/apt install ripgrep)
pip install -r requirements.txtMORPH_API_KEY=your-key python search.pySearch a specific repo:
MORPH_API_KEY=your-key python search.py "Find auth middleware" /path/to/repoThe agent runs a multi-turn conversation with the morph-warp-grep-v2.1 model using OpenAI-compatible tool calling:
- Send the repo structure + search query to the API (tools are built in — no
toolsparameter needed) - Receive structured
tool_callsfrom the JSON response - Execute tools locally using ripgrep and file reads
- Send results back as
toolmessages withtool_call_id - Repeat until the model calls
finish(max 6 turns)
Each component (API client, tool executors, dispatcher, agent loop) is clearly separated in the code.