Using LLM in the shebang line of a script
Simon Willison published a TIL (Today I Learned) on 11th May 2026, demonstrating how to use his LLM tool in the shebang line of scripts. The simplest approach leverages LLM fragments, but more advanced usage includes tool calls via the -T option and direct execution of YAML templates defining Python functions. A debug flag (--td tools) outputs tool details. The post also references a complex example using the Datasette SQL API to answer questions about blog content. Willison offers a $10/month sponsorship for a curated email digest of monthly LLM developments.
Key facts
- Simon Willison posted on 11th May 2026
- LLM can be used in shebang lines
- Simplest method uses LLM fragments
- Tool calls supported via -T option
- YAML templates can define Python functions
- --td tools debug option outputs tool details
- Complex example uses Datasette SQL API
- Sponsorship at $10/month for LLM digest
Entities
Institutions
- Simon Willison
- Datasette