Skip to content
InfoNewsLLM-specific

Using LLM in the shebang line of a script

Published
Record updated
View JSON

Summary

Simon Willison shows how to use the llm command-line tool in a script's shebang line, so an English text file can run as an executable. He demonstrates three patterns: loading fragments with -f, enabling tool calls with -T, and running YAML templates that define extra tools as Python functions. He includes a calculator example that uses the --td tools debug option to print each tool call and its result.