5 ms·
Just-bash: Bash for Agents
- gaigalas 9mo agohttps://github.com/vercel-labs/just-bash/blob/main/src/spec-tests/bash/KNOWN_LIMITATIONS.md https://github.com/vercel-labs/just-bash/blob/main/src/spec-... That's a lot of incompatibilities. LLMs like to use the shell because it's stable and virtually unchanged for decades. It doesn't need to worry much about versions or whether something is supported or not, it can just assume it is. Re-implementing bash is a herculean effort. I wish good luck.
- esafak 9mo agoNo, they use it because there's a lot of training material. pro-tip: vercel's https://agent-browser.dev/ https://agent-browser.dev/ is a great CLI for agent-based browser automation.
- gaigalas 9mo ago[flagged]
- athorax 9mo agoWhy do you think there is a lot of training data? Could it be because it's stable and virtually unchanged for decades? Hmmm.
- esafak 9mo agoBecause bash is everywhere. Stability is a separate concern. And we know this because LLMs routinely generate deprecated code for libraries that change a lot.
- gaigalas 9mo agoThis project runs on all shells, totally portable: https://github.com/alganet/coral https://github.com/alganet/coral busybox, bash, zsh, dash, you name it. If smells bourne, it runs. Here's the list: https://github.com/alganet/coral/blob/main/test/matrix#L50 https://github.com/alganet/coral/blob/main/test/matrix#L50 (more than 20 years of compatibility, runs even on bash 3) It's a great litmus test, that many have passed. Let me know when just-bash is able to run it.
- esafak 9mo agoI have no connection to coral or just-bash. Why don't you do it yourself and let us know, since you are familiar with it?
- gaigalas 9mo agoI've been working with the shell long enough that I know just by looking at it. Anyway, it was rethorical. I was making a point about portability. Scripts we write today run even on ancient versions, and it has been an effort kept by lots of different interpreters (not only bash). I'm trying to give sane advice here. Re-implementing bash is a herculean task, and some "small incompatibilities" sometimes reveal themselves as deep architectural dead-ends.
- esafak 9mo agoThe project does not list portability as a concern. It's for agent use; they are not trying to re-use existing bash code.
- gaigalas 9mo agoBefore, you said: > they use it because there's a lot of training material. Now, you say: > they are not trying to re-use existing bash code. Can't you see how this is a contradiction? --- I'm sorry, I can't continue like this. I want to have meaningful conversations.
- esafak 9mo agoIs English your second language? "They" refers to very different things here.
- gaigalas 9mo agoThe issue here is not language, is basic understanding of how LLMs are trained, how agents act on that training and what is the role of the shell from a systems perspective. I can't have a meaningful conversation with someone that doesn't fully grasp those, no matter in which language.
- simonw 9mo agoIncompatibilities don't matter much provided your error messages are actionable - an LLM can hit a problem, read the error message and try again. They'll also remember that solution for the rest of that session.
- gaigalas 9mo agoI don't think the current incompatibilities can be worked around. Also, huge waste of tokens. And the waste is not even worth it, the sandbox seems insufficient. Again, good luck to the developers. I just don't think it's ready.
- cramforce 9mo agoI would not over-read into that doc. In practice, the only missing stuff are extreme edge cases of the type that is actually not consistent between other implementations of bash. In practice it works great. I haven't seen a failed command in a while [Disclaimer: I made the thing]
- gaigalas 9mo agoI gave it a shot. Failed with a simple `> /dev/null` redirection. LLMs do that a lot. Good luck with the project! I'm sure it will get there.
- jpitz 9mo agoJust curious: why wouldn't you attack this with a jail?
- wild_egg 9mo agoJails are alien magic and typescript is safe and familiar
- otterley 9mo agoWhat, exactly, is "safe" about TypeScript other than type safety? TypeScript is just a language anyway. It's the runtime that needs to be contained. In that sense it's no different from any other interpreter or runtime, whether it be Go, Python, Java, or any shell. In my view this really is best managed by the OS kernel, as the ultimate responsibility for process isolation belongs to it. Relying on userspace solutions to enforce restrictions only gets you so far.
- wild_egg 9mo agoAh I forgot to add an /s I agree on all counts and that this project is silly on the face of it. My comment was more that there is a massive cohort of devs who have never done sysadmin and know nothing of prior art in the space. Typescript "feels" safe and familiar and the right way to accomplish their goals, regardless of if it actually is.
- lombasihir 9mo agoagree, or just busybox or alpine linux that will have more flexibility? but i think its still useful if we are bound to js/ts ecosystem sandboxed enviroment like in vercel.
- huntaub 9mo agoWe just released a driver that allows users of just-bash to attach a full Archil file system, synced to S3. This would let you run just-bash in an enrivonment where you don't have a full VM and get high-performance access to data that's in your S3 bucket already to do like greps or edits. Check it out here: https://www.npmjs.com/package/@archildata/just-bash https://www.npmjs.com/package/@archildata/just-bash
- IceWreck 9mo agoAt this point why not make the agents use a restricted subset of python, typescript or lua or something. Bash has been unchanged for decades but its not a very nice language. I know pydantic has been experimenting with https://github.com/pydantic/monty https://github.com/pydantic/monty (restricted python) and I think Cloudflare and co were experimenting with giving typescript to agents.
- wild_egg 9mo agoAgents really do not care at all how "nice" a language is. You only need to be picky with language if a human is going to be working with the code. I get the impression that is not the use case here though
- bigbadfeline 9mo ago> Agents really do not care at all how "nice" a language is. People do care. > You only need to be picky with language if a human is going to be working with the code. Sooner or later humans will have to work with the code - if only for their own self-preservation. > I get the impression that is not the use case here though If that's not the use case, there's no legitimate use case at all.
- fragmede 9mo ago> Sooner or later humans will have to work with the code We want that to be true, but it's starting to look like it might not be.
- wild_egg 9mo agoI might have misinterpreted what the submitted link is offering then. I thought this was some "secure" sandboxing thing where agents can write ephemeral scripts as tool calls to take arbitrary actions. No human will be looking at that. It's not checked into a repo and is not maintained. One-off throwaway scripts can be written in literally anything. It does not matter.
- bandrami 9mo ago
- Lerc 9mo agoI have been playing around with something like this. I'm not going for compatibility, but something that is a bit hackable. Deliberately not having /lib /share and /etc to avoid confusion that it might be posix On neocoties for proof of static hosting https://lerc.neocities.org https://lerc.neocities.org
- arminsergiony 9mo ago[dead]
- RobertLong 9mo agoThis ends up reading files into node.js and then running a command like grep but implemented in JS. I love the concept but isn’t this incredibly slow compared to native cli tools? Building everything in JS on top of just readFile and writeFile interfaces seems pretty limited in what you can do for performance.
- simonw 9mo agoPerformance of the tools doesn't really matter when you have a full LLM inference loop in between each tool call.
- tcdent 9mo agoI still find it revolting they're writing this stuff in typescript.
- cramforce 9mo agoIn practice it is actually extremely fast because there is no process fork. You're talking nanoseconds for common commands [Disclaimer: I made the thing]
- _pdp_ 9mo agoInteresting concept but I think the issue is to make the tools compatible with the official tools otherwise you will get odd behaviour. I think it is useful for very specific scenarios where you want to control the environment with a subset of tools only while benefiting from some form of scripts.
- dostick 9mo agoWhy couldn’t they name it `agent-bash` then? What’s with all the “just-this”, “super-that” naming? Like developer lost the last remaining brain cells developing it, and when it’s came to name it, used the first meaningless word that came up. After all you’re limiting discovery with name like that.
- deleted 9mo ago[deleted]
- jeffchuber 9mo agolast weekend I vibe-coded a project called `openfs` that plugs into just-bash https://github.com/jeffchuber/just-bash-openfs https://github.com/jeffchuber/just-bash-openfs it puts a bash interface in front of s3, filesystem (real and in-memory), postgres, and chroma. still very much alpha - but curious what people think about it. see an example app here: https://github.com/jeffchuber/openfs-incident-app https://github.com/jeffchuber/openfs-incident-app
- andrewingram 9mo agoI did a slightly less ambitious prototype a few weeks ago where I created added lazy loading of GCS files into the just-bash file-systems, as well as lots of other on-demand files. Was a lot of fun.
- jeffchuber 9mo agoyeah (optional) caching is interesting to think about - incl write_through and write_back
- JustFinishedBSG 9mo agoWhat problem were you trying to solve ? ( not that you need to solve one. I’m just curious )
- sentra 9mo ago[dead]
- raphaelmolly8 9mo ago[dead]
- SignalStackDev 9mo ago[dead]
- MidasTools 9mo ago[flagged]
- tmp10423288442 9mo agoPerl?
- throwaway13337 9mo agoThe unix commandline tools being the most efficient way to use an LLM has been a surprise. I wonder the reason. Maybe 'do one thing well'? The piping? The fact that the tools have been around so long so there are so many examples in the training data? Simplicity? All of it? The success of this project depends on the answer. Even so, I suspect that something like this will be a far too leaky abstraction. But Vercel must try because they see the writing on the wall. No one needs expensive cloud platforms anymore.
- justaboutanyone 9mo agoShell programming is high density inter-language glue. You simply have more options of implementations to call out to and so less to write. I can trivially combine a tool written in rust with one written in js/java/C/whatever without writing bindings
- cyanydeez 9mo agoIf you want a better guess: It's because of the man pages for all the tools are likely duplicated across so many media for the LLM training that there's just an efficient pipeline. They go back to the 70s or whatever. So, mostly re-enforcement along multiple vectors.
- fragmede 9mo agoI'm not convinced. I don't want to rack servers and diagnose bad RAM like it's still the 90's, so I'm paying someone else for the privilege, especially to get POPs closer to customers than I want to drive or fly to setup, especially in foreign countries where I don't speak the language or know the culture. Fun for vacation but a recipe to waste time and money setting up a local corporate entity and a whole team when I can just pay GCP or AWS and have a server on the other side of the planet from me faster than I can book a plane flight and hotel reservation there. There's also the maintenance of the server to be considered. Vercel or other PaaS/Lambda/GCP functions/etc serverless means there's just less crap for me to manage, because they're dealing with it, and yeah, they charge money for that service. Being able to tell Claude code, I setup ssh keys and sudo no password for you, go fix my shit; like, that works, but then the hard drive is full so I have to up size the VPS, and if you're stupid/brave, you can give Claude Code MCP access to Chrome so it can click the buttons in Hetzner to upsize for you, but that's time and tokens spent not working on the product so at the end of the day I think Vercel is gonna be fine. AI generating code means there are many many more people trying out making some sort of Internet company, but they'll only discover cheaper options only after paying for Vercel becomes painful.
- CuriouslyC 9mo agoTrying to secure the sandbox the harness is running in seems like the hard way to do things. It's not a bad idea, but I think it'd be easier to focus on isolating the sandbox and securing resources the harness sandbox accesses, since true security requires that anyhow.
- rob 9mo agoWeb UI for it: https://justbash.dev https://justbash.dev
- rbbydotdev 9mo agoIt’s cool to see this project and others pop up. Virtualizing os primitives like bash and even file systems You can interface around the nodejs files system interface and have access to some nice tools, like git isomorphic for instance. Then obviously everything couples nicely with agents. Something I did in my markdown editor project: https://github.com/rbbydotdev/opal https://github.com/rbbydotdev/opal Have half a mind to release a browser kit which unifies the file tree explorer and virtual file apis and libs in the browser
- agartner 9mo agoIf anyone is looking to make a similar thing in go I suggest https://pkg.go.dev/mvdan.cc/sh/v3/interp https://pkg.go.dev/mvdan.cc/sh/v3/interp I've been using it to make my own sandbox that is much more configurable than the default claude code sandbox: https://github.com/gartnera/lite-sandbox https://github.com/gartnera/lite-sandbox
- indigodaddy 9mo agoNot sure why I would ever want to use this over bash in a sandboxed VM.
- 0xDEFACED 9mo agochmod with extra steps
- rothific 9mo agoI'm hacking on a similar thing that lets you build CLIs directly into xterm / ghostty web so that they also work in the terminal. Eg they are cross platform web and CLI. Demo: https://wizard-nine-blush.vercel.app/ https://wizard-nine-blush.vercel.app/ Project: https://ink-web.dev https://ink-web.dev I love the approach of just bash as well. Super cool! Edit: warning - don't use it mobile.