Simon Willison's llm CLI tool already does a lot — run prompts, manage models, call tools, store logs in SQLite. But a Hacker News comment last week sent him down a rabbit hole, and the result is one of those tricks that makes you stop and stare.
You can now put llm in a shebang line and make a plain text file directly executable.
"But seriously, you can put a shebang on an english text file now (if you're sufficiently brave) [...]"
— Kim_Bruning, Hacker News
What this actually looks like
The simplest form uses llm 's fragments mechanism ( -f ), which reads the file's contents as a prompt:
#!/usr/bin/env -S llm -f Generate an SVG of a pelican riding a bicycle
Enter fullscreen mode
Exit fullscreen mode
Save it, chmod +x , run it. That's it. The file IS the prompt.
The -S flag on env is the key detail — without it, env treats llm -f as a single command name and errors out.…