New TIL: I figured out how to use my LLM CLI tool in a shebang line, which means you can write executable scripts in English, or hook up more complex scripts with a snippet of YAML template https://t.co/8mngqTbiTO
Simon Willison Turns English Prompts into Executable Scripts Using Shebang Lines
Simon Willison· Updated
Simon Willison discovered a pattern to use the Unix shebang line with his llm CLI tool, making natural language prompts directly executable. This allows developers to treat AI prompts and complex YAML templates as standalone terminal utilities that can be piped and scripted like any other program.
#!/usr/bin/env -S llm -f shebang line. This pattern leverages Simon Willison's llm fragments mechanism to append script contents directly to a prompt, turning plain text files into functional command-line tools.This discovery shifts AI interaction from reactive chatting to standard Unix engineering. By wrapping prompts in executable files, users can define specific models, system instructions, and embedded Python functions as tools. It bridges the gap between Simon Willison's vibe coding thesis and reliable, repeatable terminal-based automation.
You can now build custom AI utilities—like an SVG generator or blog search tool—without writing boilerplate wrapper code. These scripts support parameters and tool-calling, making them ideal for automating repetitive data tasks. The llm tool is open-source and supports frontier models like GPT-5.5 access via Codex.
Still wondering? A few quick answers below.
Every HeadsUpAI update is written based on its original source and reviewed before it's published. Read our editorial standards →


