Provides bash, readFile, and writeFile tools for AI agents. Supports @vercel/sandbox for full VM isolation.
pnpm install bash-toolimport { generateText, stepCountIs } from 'ai';import { createBashTool } from 'bash-tool';
const { tools } = await createBashTool({ files: { 'src/index.ts': "export const hello = 'world';" },});
const { text } = await generateText({ model: 'anthropic/claude-sonnet-4', prompt: 'List the files in src/ and show me the contents of index.ts', tools, stopWhen: stepCountIs(5),});
console.log(text);