Skip to content

Instantly share code, notes, and snippets.

View andrewsanchez's full-sized avatar
🎯
Focusing

Andrew Sanchez andrewsanchez

🎯
Focusing
  • AnkiHub
  • Flagstaff, Arizona
View GitHub Profile
@andrewsanchez
andrewsanchez / llm-mgrep-tool.md
Last active December 4, 2025 17:33
Example of using the mgrep CLI tool with an llm tool
➜ llm --td --cl 20 --functions '
import subprocess
def mgrep(pattern: str, path: str = ".") -> str:
    """Call mgrep for semantic search across files under the given path."""
    result = subprocess.run(["mgrep", "search", pattern, path], capture_output=True, text=True, timeout=30)
    return result.stdout if result.returncode == 0 else result.stderr
  ' \
-s "Use mgrep extensively to search the current working directory to answer the user's question. mgrep is powerful semantic search tool." \
"Write a plugin that defines a toolbox for using the mgrep search cli tool.
@andrewsanchez
andrewsanchez / bach_analysis.ipynb
Last active October 24, 2019 00:16
bach_analysis.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.