Oh nice, that's really cool. I'm seeing uv pop up in more and more places. Python really needed this tooling upgrade. Also, I'll make a mental note of -S, awesome.
If you want to do the same with javascript or typescript, you can just use bun, it will auto-install[1] the packages included in there.
#!/usr/bin/env bun
[1]:
https://bun.sh/docs/runtime/autoimport