LLM Command Line Tool

Simon Willison has a cool tool called :llm that can be used to work with LLMs via the command line. It’s designed to be used in many flexible ways and is consistent with the *nix philosophy of being able to work magic on the command line with swiss-army knife flexibility.

So rather than fire up another chat window and copying/pasting content, you can simply use the command line to invoke the LLM and pass in your query. You can also include attachments like PDFs or markdown files to query off.

For instance, I recently went on vacation and I put in notes about the trip in a markdown file. For instance, I put in a few things I liked and were must-haves on a future trip there. And I also added things I wanted to do next time. So now I can simply invoke tips for my future trip there with:

llm -f ./*.md "What are some things i should do on my next trip to Lake George?"

You can even run an interactive chat with the LLM right from the command line without having to, you guessed it, open up a browser window and fire up yet another chat. You can do this with:

llm chat -m gpt-4.1

Here’s a :great video and primer on the tool! In fact, this video was my introduction to the tool and is awesome. There’s a part 2 to the video as well where people in the hackathon use the tool to create some cool projects. Check it out!

Subscribe to Dante Newsletter

One update per week. All the latest posts directly in your inbox.