---
title: "Building AI agents with just bash and a filesystem in TypeScript"
description: "just-bash, a from-scratch TypeScript reimplementation of bash and common commands like grep, sed, awk and jq, gives AI agents a familiar shell tool without a real shell or host filesystem access."
url: "https://swe.quest/articles/building-ai-agents-with-just-bash-and-a-filesystem-in-typescript-0ae4e4a2ddfb7c37"
canonical: "https://turso.tech/blog/agentfs-just-bash"
source: "Turso"
published: "2026-01-02"
difficulty: "medium"
kind: "How-to"
reading_minutes: 3
tags: ["ai-agents","sandboxing","typescript","sqlite"]
---

# Building AI agents with just bash and a filesystem in TypeScript

A post on [Turso](https://swe.quest/sources/turso.md), published 2026-01-02, 3 min read, How-to. Original: [https://turso.tech/blog/agentfs-just-bash](https://turso.tech/blog/agentfs-just-bash)

## Summary

just-bash, a from-scratch TypeScript reimplementation of bash and common commands like grep, sed, awk and jq, gives AI agents a familiar shell tool without a real shell or host filesystem access. Its pluggable filesystem interface connects to AgentFS, which stores every file in an SQLite database via Turso (or Cloudflare's managed SQLite in Durable Objects), so all changes are captured and the agent cannot escape the sandbox. Code examples show wiring it into the Vercel AI SDK. It sits between direct AgentFS SDK calls and mounting AgentFS on the host: deployable anywhere JavaScript runs, but limited to the commands just-bash implements.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)

## Prerequisites

- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- TypeScript basics ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- Unix shell commands

## Keywords

just-bash, AgentFS, Turso, Vercel AI SDK, Cloudflare Workers, Durable Objects, SQLite

## Related posts

- [AgentFS in the Browser](https://swe.quest/articles/agentfs-in-the-browser-5b295716ac634197.md): Turso · 2025-12-22 · Medium · 5 min read · AI agents, SQLite, WebAssembly, Browsers, Local-first & sync
  AgentFS gives browser-based agents a virtual filesystem stored in a SQLite database, using Turso's WASM build of its Rust rewrite of SQLite.
- [The Missing Abstraction for AI Agents: The Agent Filesystem](https://swe.quest/articles/the-missing-abstraction-for-ai-agents-the-agent-filesystem-ef7d12c3499d3c42.md): Turso · 2025-11-13 · Medium · 8 min read · AI agents, SQLite, Observability, Storage systems
  AgentFS is an SDK that stores all of an AI agent's state in a single SQLite (Turso) database file: a POSIX-like virtual filesystem, a key-value store, and an append-only tool call audit log.
- [Agents in the Sandbox](https://swe.quest/articles/agents-in-the-sandbox-6c4d7e3dae7cde47.md): Railway · 2026-06-24 · Medium · 9 min read · AI agents, Sandboxing & isolation, Developer tools, TypeScript
  Railway sandboxes now ship Claude Code, Codex, OpenCode and Pi in the default image and can join an environment's private network, which lets agents test against real Postgres, Redis and internal services.
- [AgentFS with copy-on-write overlay filesystem](https://swe.quest/articles/agentfs-with-copy-on-write-overlay-filesystem-c1809b9cbbc5773b.md): Turso · 2025-12-31 · Medium · 5 min read · Sandboxing & isolation, AI agents, Storage systems, Linux, SQLite
  AgentFS 0.4 adds \`agentfs run\`, which launches a coding agent in a sandbox where the working directory is a copy-on-write overlay.
- [AgentFS with FUSE: SQLite-backed agent state as a POSIX filesystem](https://swe.quest/articles/agentfs-with-fuse-sqlite-backed-agent-state-as-a-posix-filesystem-5f39c709b604ee45.md): Turso · 2025-12-08 · Medium · 7 min read · AI agents, SQLite, Linux, Storage systems, Rust
  AgentFS adds an \`agentfs mount\` command that exposes its SQLite-backed agent filesystem as a real POSIX filesystem via Linux FUSE.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
