bai | a small Linux shell helper that generates shell commands
Posted by transfire@reddit | linux | View on Reddit | 14 comments
I built a tiny command-line tool called bai that takes a plain-English request and turns it into a shell command.
Example:
$ bai find large log files modified this week
It prints a command and copies it to the clipboard so you can paste, inspect, edit, or ignore it. It does not execute commands automatically.
- BYOK: works with Anthropic or OpenAI
- supports Bash, Zsh, Fish, Dash, Nu, and a few others
- config can live in ~/.config/bai/
- has --explain, --strict, --json, and --show-config
- packages are available for Arch, Debian/Ubuntu, and Fedora
- written in Crystal, so it's a compiled executable
The main design goal is to keep it boring and safe: one request in, one command out, human always stays in the loop.
Repo: https://github.com/trans/bai Packages: https://github.com/trans/bai/releases/tag/v0.4.2
Contrite42@reddit
fzf + ripgrep + fd does most of the work. add bat if you want syntax-highlighted previews.
the thing that actually changed my workflow was fzf's
**<tab>completion. typevim **<tab>, fuzzy-pick the file, done. stopped typing paths almost entirely after that.ripgrep alone is worth it btw, grepping a big repo went from "go get coffee" to instant.
Savings_Walk_1022@reddit
my computer is lagging looking at this website š
transfire@reddit (OP)
The CSS performance issue I believe was caused by `backdrop-filter: blur(...)`. `backdrop-filter` makes the browser blur whatever is behind translucent elements during compositing, which can be expensive on some Linux/browser/GPU setups. I removed those filters and the old floating background text animation. Hopefully that solves the issue.
Thank you for letting me know!
transfire@reddit (OP)
Oh the classic āworks on my machineā. Thanks Iāll fix it.
Adorable-One362@reddit
Just install command fails on line 6 in "build" on opensuse tumbeweed.
transfire@reddit (OP)
Thanks I look into it.
transfire@reddit (OP)
Fixed and I did an end-to-end install via a Podman VM instance of openSUSE, and it worked. So 0.4.3 should be good to go. (https://github.com/trans/bai/releases).
I appreciate you letting me know about the issue. Hopefully it is fully resolved now. Thank you.
TheG0AT0fAllTime@reddit
Vibecoded fuckass trash
transfire@reddit (OP)
Sigh.
As far as programs go, this is about as simple as it gets. So who cares if the code isn't all neat and tidy, as long as it works? And if you think I vibe coded it because I don't know how to program, well you haven't looked at my Github account. I've been coding for decades.
Actually think about this: what has AI let me do? I could have coded this by hand. And spent a handful of weekends just on this a little tool (ARCH, Debian and RPM packages alone can take days to hand craft.) But right now, I have Claude Code fixing the RPM, testing it against a Podman instance of both Fedora and OpenSuSE. (I made a mistake not doing that sooner, but correcting in now). I could have spent a week doing that myself. But I have other things I prefer to, Claude did in in 30 minutes.
It's a trade-off and for a while, yeah you have to deal with some "sloppy" code. But it is only going to improve. So better to get used to working with AI now, so we can learn how to work with it and get it to write better code.
codeasm@reddit
Youll get less hate if your upfront about when, where and how much ai was involved. I see no mention of it in the readme.
necrophcodr@reddit
It seems it didn't just fix it in 30 minutes though. Maybe it is faster, but is the usefulness and quality of the product as good? Im ignoring the code itself entirely here, because it seems that there are functional issues still.
LesStrater@reddit
You lost me at, "The name comes from the Chinese
bai, associated with clarity and understanding."Anyone who has ever read the instruction manual for a product made in China knows that there is no such thing as "clarity and understanding".
mina86ng@reddit
Make it run locally and then weāll talk.
SystemAxis@reddit
A lot of these tools fall apart when they try to be too clever. Keeping it to 'generate a command and let the user review it' seems like the right approach.