import { generateText, isStepCount } 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-5.5',
prompt: 'List the files in src/ and show me the contents of index.ts',
tools,
stopWhen: isStepCount(5),
});
console.log(text);