←back to thread

165 points gdudeman | 6 comments | | HN request time: 0.208s | source | bottom
1. flenserboy ◴[] No.44482473[source]
Has anyone tried this for command line applications? This could be a great way to develop some very specific/corner-case tools.
replies(1): >>44482615 #
2. simonw ◴[] No.44482615[source]
I write CLI tools with LLMs all the time. I even have a custom Claude Project that teaches the LLM to use inline script dependencies with uv so I can "uv run script.py" without first having to install anything else: https://simonwillison.net/2024/Dec/19/one-shot-python-tools/

I have a collection of tools I've built in this way here: https://tools.simonwillison.net/python/

replies(2): >>44482806 #>>44483052 #
3. flenserboy ◴[] No.44482806[source]
Very cool! Thank you.
4. kiitos ◴[] No.44483052[source]
A CLI tool is a native binary that I can run directly via e.g. `/path/to/binary`. If I need to use `uv run ...` to execute something, then that thing isn't really a CLI tool, it's an interpreted script, which relies on an interpreter that needs to be available as a pre-requisite, and all of the numerous complications that follow from that...
replies(1): >>44483583 #
5. simonw ◴[] No.44483583{3}[source]
Use this as your shebang line:

  #!/usr/bin/env -S uv run --script
https://treyhunner.com/2024/12/lazy-self-installing-python-s...

I don't think requiring all CLI tools to be "native binaries" makes sense. Plenty of popular CLI tools are not compiled binaries. The Python and Node.js ecosystems run on those.

replies(1): >>44504717 #
6. kiitos ◴[] No.44504717{4}[source]
You're describing scripts, which require interpreters like I guess uv or Node or Python. A CLI tool is a native binary.