cjbell

cjbell

Just_bash - a bash interpreter + virtual filesystem in Elixir (and how we use it to power an agent in production)

Hey all — Chris here, CTO at Knock. We’re an Elixir shop (Phoenix, Oban, the works) and we recently shipped an AI agent for managing customer messaging resources. I wanted to share two things with this community:

1. just_bash: a full bash interpreter and virtual filesystem in pure Elixir

The backstory: we wanted our agent to explore account context via a filesystem and bash (the pattern Vercel wrote about with their just-bash TypeScript library) rather than an ever-growing pile of bespoke tools. But we didn’t want to leave Elixir, and we didn’t want to boot a container per agent session.

So Ivar Vong ported just-bash to Elixir — full interpreter, virtual FS, support for the common commands (jq, grep, ls, cat, etc.), with the original project’s test suite reused as fixtures to keep the port honest. Everything runs in-memory as a regular process, so a “sandbox” for us is just another process in the cluster: lazy-started on first use, long-lived across a multi-turn session, cheap to kill.

This felt like a case where the BEAM is quietly a perfect fit: per-session isolated processes, no container orchestration, instant starts, and supervision for free.

2. How we built the agent on top of it

Full writeup: Files over tools: how we built the Knock Agent using a virtual file system and bash | Knock

The short version: the agent gets a virtual filesystem bootstrapped with account metadata, lazily loads full resources when needed, edits files in place, and persists changes back through the same internals as our management API. The agent loop is a durable Oban workflow (safe retries mid-loop), the event log streams to clients as NDJSON, and we run nightly trajectory evals.

Happy to go deep on any of it — the Oban-backed loop design, how we handle compaction across turns, or the just_bash internals. And if anyone kicks the tires on the library, issues and PRs are very welcome.

Where Next?

Popular in AI / LLMs Top

garrison
For those who are not aware, “AI agents” are, for the most part, commodity LLMs which are given access to “tools” and prompted to complet...
#ai
New
AstonJ
After reading the below in another thread… It got me wondering how many firms are actually using or encouraging their developers to use...
New
shreya_tech
Lately, it feels like every new repo is an “Autonomous Agent.” While the idea of an AI that “figures it out” is cool, I’m finding that fo...
New
New
Cheezy
I am using Claude Remote Control for the first time this morning. AMAZING! I’m running one remote session on my iPad while running anothe...
New
borag
I shared an Elixir Architect skill for Claude Code which proves that Elixir is the best LLM friendly language (@josevalim ) https://git...
New
AndyL
Elixir has rapidly changing hex packages, both public and private. For people who use AI Coding Tools (Aider, Cursor, Windsurf, etc.), h...
New
Cheezy
I spent the month of January building and refining a tool to help with Team / AI collaboration. Several friends have provided feedback an...
New
dogweather
First, the downsides. I periodically fire the AI. :smiling_face_with_tear: ^^ This was earlier today in Cursor AI, working with “Clau...
New
DaAnalyst
Just saw a link to this on Zerohedge: It’s not AI. It’s a controlled lab-grown HI (Human Intelligence) currently at ~800K ...
New

Other popular topics Top

axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 48342 226
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement