# LLM CLI tools in shebang lines

til · 2026-05-11

import HLSVideo from '@components/content/HLSVideo.astro';
import PiExtensionLink from '@components/content/PiExtensionLink.astro';
import PiSessionLink from '@components/content/PiSessionLink.astro';

> 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
>
> — [@simonw](https://x.com/simonw/status/2053914709720764770)

It's becoming a meme at this point, but here's a Pi extension to do the same:

<HLSVideo slug="pi-video-speedup" assetPath="blog/pi-video-speedup/videos/pi-video-speedup" caption="Pi extension for LLM shebang scripts" speed={2} alt="Demonstration of a Pi extension for running LLM shebang scripts" />

<PiExtensionLink href="https://gist.github.com/aliou/17322b3fa9e816e2231fd4be05005398" />

Also watch GLM-5.1 completely overthink while trying to speed up the video and add a fast-forward overlay.

<PiSessionLink href="https://pi.dev/session/#e474641122d26ea4dd60591d736d7240" />
