Simon Willison’s Weblog

Subscribe

q What do I title this article? (via) Christoffer Stjernlöf built this delightfully simple shell script on top of LLM. Save the following as q somewhere in your path and run chmod 755 on it:

#!/bin/sh
llm -s "Answer in as few words as possible. Use a brief style with short replies." -m claude-3.5-sonnet "$*"

The "$*" piece is the real magic here - it concatenates together all of the positional arguments passed to the script, which means you can run the command like this:

q How do I run Docker with a different entrypoint to that in the container

And get an answer back straight away in your terminal. Piping works too:

cat LICENSE | q What license is this