← ClaudeAtlas

testdriverexeclisted

Execute shell or PowerShell commands in the sandbox
testdriverai/testdriverai · ★ 243 · Testing & QA · score 73
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from exec.mdx. DO NOT EDIT. --> ## Overview Run shell commands (Linux) or PowerShell commands (Windows) in the sandbox. ## Syntax ```javascript await testdriver.exec(language, code, timeout, silent) ``` ## Parameters <ParamField path="language" type="string" required> The language to run: `'sh'` (Shell/Linux) or `'pwsh'` (PowerShell/Windows) </ParamField> <ParamField path="code" type="string" required> The code or the command to run </ParamField> <ParamField path="timeout" type="number" required> The timeout in milliseconds </ParamField> <ParamField path="silent" type="boolean" default="false"> If `true`, TestDriver does not show the output </ParamField> ## Returns `Promise<string>` - The command output ## Shell Execution (Linux) Run shell commands in the Linux sandbox. ### Basic Commands ```javascript // List files const files = await testdriver.exec('sh', 'ls -la', 5000); // Check current directory const pwd = await testdriver.exec('sh', 'pwd', 5000); // Run a script await testdriver.exec('sh', './setup.sh', 60000); ``` ### File Operations ```javascript // Create a file await testdriver.exec('sh', 'echo "Hello World" > test.txt', 5000); // Read a file const content = await testdriver.exec('sh', 'cat test.txt', 5000); // Copy files await testdriver.exec('sh', 'cp source.txt dest.txt', 5000); // Delete files await testdriver.exec('sh', 'rm test.txt', 5000); ``` ## PowerShell Execution (Windows) Execute PowerShell commands in the