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.
- 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
main.ts- Entry pointagent.ts- Agent logic using AI SDK'sstreamTextwith just-bash'screateBashToolshell.ts- Interactive readline shell
-
Install dependencies:
npm install
-
Set your Anthropic API key:
export ANTHROPIC_API_KEY=your-key-here -
Run:
npm start
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.
npm run typecheck