@tpmjs/official-sandbox-shell
Write or create a file in the sandbox workspace.
writeFile requires a sandbox session (_sandboxWorkDir not set)
Last checked: 3/1/2026, 4:27:22 AM
Test @tpmjs/official-sandbox-shell (writeFile) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/official-sandbox-shellpnpm add @tpmjs/official-sandbox-shellyarn add @tpmjs/official-sandbox-shellbun add @tpmjs/official-sandbox-shelldeno add npm:@tpmjs/official-sandbox-shellimport { writeFile } from '@tpmjs/official-sandbox-shell';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { writeFile } from '@tpmjs/official-sandbox-shell';
const result = await generateText({
model: openai('gpt-4o'),
tools: { writeFile },
prompt: 'Your prompt here...',
});
console.log(result.text);(path: string, content: string, createDirs?: boolean, _sandboxWorkDir?: string) => Promise<unknown>Available configuration options
pathstringFile path relative to workspace root
contentstringContent to write to the file
createDirsbooleanCreate parent directories if they do not exist (default: true)
_sandboxWorkDirstringInjected by sandbox server — workspace directory
Schema extracted: 3/1/2026, 4:27:22 AM
ERROR: No README data found!
Downloads/month
98
GitHub Stars
15
Quality Score