daily-hour-news·

🛠️How to Put an LLM in a Script's Shebang Line

TL;DR

Simon Willison shows how to use his llm CLI in a script's shebang line so the file itself becomes an LLM-powered program. The short TIL walks through the exact syntax and a working example you can copy.

Simon Willison shows how to use his llm CLI in a script's shebang line so the file itself becomes an LLM-powered program. The short TIL walks through the exact syntax and a working example you can copy.

Key Points

1

Uses an 'env -S llm ...' style shebang to run a prompt as an executable file

2

Turns a plain text file into a runnable LLM program with no wrapper code

3

Passes the script body to the llm tool as the prompt

4

Posted as a TIL on May 11, 2026

Why It Matters

It is a tiny, copyable trick showing how close LLM tooling now sits to ordinary Unix scripting.

Quick Facts

Simon Willisonllm CLIshell scriptingtutorialdeveloper toolsUnix

Frequently Asked Questions

Why does this matter?

It is a tiny, copyable trick showing how close LLM tooling now sits to ordinary Unix scripting.

What happened?

Simon Willison shows how to use his llm CLI in a script's shebang line so the file itself becomes an LLM-powered program. The short TIL walks through the exact syntax and a working example you can copy.

Comments

Subscribe to join the conversation...

Be the first to comment

Enjoyed this article?

Get it daily. 7am. Free. Reads in 5 minutes.