I’m using llm more and more, and today I had to find back prompts I used in the past. Here is a command I’ve been using, which allows me to filter the results based on what I want. It leverages sql-utils, a cli tool which is able to talk to a SQLITE database and answer in json, and jq a command-line tool capable of doing requests for json.
All in all, it’s pretty satisfying to use. I finally got a simple way to query databases! I’m also using glow, which is capable of transforming markdown into a better version on the terminal.
sqlite-utils "$(llm logs path)" "SELECT * FROM responses WHERE prompt LIKE '%search%'" | jq '..response' -r | glow
Which got me a colored response :-)