simonw / symbex

Find the Python code for specified symbols
Apache License 2.0
231 stars 6 forks source link

Initial design #1

Closed simonw closed 1 year ago

simonw commented 1 year ago

The goal of this tool is to work a bit like https://github.com/simonw/strip-tags in that it's a way to quickly find context to pipe into a Large Language Model (ChatGPT etc) using https://github.com/simonw/llm

It should behave a little bit like ripgrep, except here the goal is for you to provide a Python identifier - a function name or class name - and it will then output the code for that specific symbol.

simonw commented 1 year ago

Initial design:

# Search current directory and subdirectories
py-grep my_function

# Search a specific file
py-grep MyClass -f my_file.py

# Search within a specific directory and its subdirectories
py-grep Database -d ~/projects/datasette