by simonw · 2y ago · 0 comments
pip install files-to-prompt llm llm-claude-3
llm keys set claude
# paste in your Claude API key
llm models default claude-3.5-sonnet
files-to-prompt my-github-repo/ | llm --system 'say OK'
And now you can start an interactive chat with Claude 3.5 Sonnet pre-seeded with your files like this: llm chat --continue
The --continue will ensure it is a continuation of the previous chat session where you dumped in all those files.If you want to run against an updated copy of your files, start a new conversation with the files-to-prompt piping again.
I use Claude 3.5 for my daily coding tasks, but used Gemini Pro 1.5 to analyze a new Github repository the other day because it has a much larger context size.
You simply run `llm -m gemini-1.5-pro-preview-0409 "<your question>"`
You may have to add a credit card in order for it to give you an API key, it's been a while since I set mine up.
find "$1" -type f \( ! -regex '.*/\..*' \) -print | while IFS= read -r file
do
echo "$file"
echo "---"
cat "$file"
echo "---"
done