ZH version is available. Content is displayed in original English for accuracy.
Bash4LLM is a single-file Bash wrapper for interacting with LLMs from the terminal. I created it because I wanted something simple that worked without installing Python, Node, or any other runtime.
It uses only Bash, curl, and jq. You can send prompts, start a small chat, process files line by line, stream output, and save session metadata in JSON format.
I tried to make it safe and predictable: no use of the system /tmp, no use of eval. Groq is supported by default, and other providers can be added with dedicated Bash scripts in the extras/providers/ folder.
Example:
echo "explains the command: ls -l" | ./bash4llm
Discussion (18 Comments)Read Original on HackerNews
thank you for your comment!
You mean the LLM writes the code based on your instructions (that's fine, I guess, but 5KLOC is huge for this kind of script).
It's certainly not because you are proud of yourself, it has been generated.
So I genuinely wonder why?
The macro sections has two functions: 1, for me, to navigate the code 2, for LLMs, to understand my structure
The project does many things, so i need a clear sections structure to separate responsibilities.
You can see more information on the documentation, but the architectural spec is only in Italian.
This is just a casual scroll through for 2 seconds at function names i recognize and can tell are crap.
https://github.com/kamaludu/bash4llm/blob/d7258163dc1cbeb6ae...
https://github.com/kamaludu/bash4llm/blob/d7258163dc1cbeb6ae...
https://github.com/kamaludu/bash4llm/blob/d7258163dc1cbeb6ae...
Sorry but this is crap. If you trust it to be an entirely self-contained abstraction that is fine. But if I'm building a brick house, and smash open 1 of the bricks, i dont want it to look this shoddy.
Any LLM you point at it, is going to be drastically dumber in editing it or auditing it because it needs to first parse all the crap a previous LLM generated. The fewer lines of code things use the better - it keeps models smarter when it matters. Plus it saves money in the long run.
. Portable - You need only: bash, coreutils, findutils, util-linux, gawk, curl, jq. No Python (slow), no Node (heavy), no Golang (need too many binaries, one for each OS, hard to maintain for one single person like me).
. Single file - only one. I write many extras, but all are optional.
. Idempotent - you copy it where you want and go!
. Transparent - open the file and read.
. Extras for all, and all optional: help file, extra providers, improved session engine, small GUI/CGI, etc...
Default (embedded) provider is Groq, because when I start the project, was the best free API service for AI.
I'm ready to answer to your question... with my terrible english...
Cristian (kamaludu)
I'm also very doubtful performance of this would be faster than python, bash is very slow.
We invited the user to rewrite it and I've moved that text to the top now, and re-upped the post so it gets its full time on /newest.