just-bash website at https://justbash.dev/
This is an interactive demo of just-bash running entirely in your browser, with an AI agent that can explore the source code.
+----------------------------------------------------------+
| BROWSER |
| +----------+ +----------+ +----------------+ |
| | xterm.js |--->| just-bash|--->| Virtual FS | |
| | Terminal | | (browser)| | (in-memory) | |
| +----------+ +----------+ +----------------+ |
| | |
| | `agent` command |
| v |
| +--------------------------------------------------+ |
| | SSE Stream (Server-Sent Events) | |
| +--------------------------------------------------+ |
+----------------------------|-----------------------------+
|
v
+----------------------------------------------------------+
| SERVER |
| +-------------+ +----------+ +----------------+ |
| |ToolLoopAgent|--->| bash-tool|--->| just-bash | |
| | (AI SDK) | | | | + OverlayFS | |
| |Claude Haiku | | - bash | | | |
| +-------------+ | - read | | Real files: | |
| | - write | | - just-bash/ | |
| +----------+ | - bash-tool/ | |
| +----------------+ |
+----------------------------------------------------------+
- Pure TypeScript bash interpreter
- Runs locally in browser for regular commands
- In-memory virtual filesystem with pre-loaded files
- No network calls for basic commands like
ls,cat,grep
- Renders a real terminal in the browser
- Handles keyboard input, cursor, colors, scrolling
- Supports ANSI escape codes for styling
- Custom command that calls the server
- Sends conversation history to
/api/agent - Streams response via Server-Sent Events (SSE)
- Displays tool calls (bash commands, file reads) in real-time
- Uses Anthropic's Claude Haiku model
- Loops automatically: think -> tool call -> observe -> think -> ...
- Stops after 20 tool calls or when done
- Streams responses back to browser
- Provides tools for the AI agent:
bash- Execute bash commandsreadFile- Read file contentswriteFile- Write files (disabled in this demo)
- Integrates with just-bash sandbox
- Overlays real filesystem (this source code) as read-only
- Agent can explore just-bash and bash-tool source
- Writes go to memory, not disk
- You type
agent "how does grep work?" - Browser just-bash runs the
agentcommand - Command POSTs to
/api/agentwith message history - Server creates ToolLoopAgent with bash-tool
- Agent thinks, calls tools (bash, readFile), observes results
- Each step streams back as SSE events
- Browser displays tool calls and final response
- Response added to conversation history for multi-turn chat
pnpm install
pnpm devOpen http://localhost:3000 to see the terminal.
- just-bash: https://github.com/vercel-labs/just-bash
- bash-tool: https://github.com/vercel-labs/bash-tool
- AI SDK: https://ai-sdk.dev
- xterm.js: https://xtermjs.org