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.
Popular in AI / LLMs
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









