Skip to content

Latest commit

 

History

History
 
 

ai-sdk-just-bash

Folders and files

README.md

AI SDK + just-bash Code Explorer Agent

An interactive AI agent that combines Vercel AI SDK, just-bash for bash command execution, and AgentFS for persistent filesystem storage.

This example is forked from the just-bash bash-agent example with AgentFS integration added.

How It Works

  • Vercel AI SDK - Orchestrates the AI agent with Claude as the model
  • just-bash - Provides a bash tool that the AI can use to execute shell commands
  • AgentFS - Backs the virtual filesystem with SQLite for persistence across sessions

Files

  • main.ts - Entry point
  • agent.ts - Agent logic using AI SDK's streamText with just-bash's createBashTool
  • shell.ts - Interactive readline shell

Setup

  1. Install dependencies:

    npm install
  2. Set your Anthropic API key:

    export ANTHROPIC_API_KEY=your-key-here
  3. Run:

    npm start

Usage

Ask questions like:

  • "What commands are available?"
  • "How is the grep command implemented?"
  • "Show me the Bash class"
  • "Find all test files"

Type exit to quit.

Development

npm run typecheck