testdriverexeclisted
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from exec.mdx. DO NOT EDIT. -->
## Overview
Execute shell commands (Linux) or PowerShell commands (Windows) in the sandbox environment.
## Syntax
```javascript
await testdriver.exec(language, code, timeout, silent)
```
## Parameters
<ParamField path="language" type="string" required>
Language to execute: `'sh'` (Shell/Linux) or `'pwsh'` (PowerShell/Windows)
</ParamField>
<ParamField path="code" type="string" required>
Code or command to execute
</ParamField>
<ParamField path="timeout" type="number" required>
Timeout in milliseconds
</ParamField>
<ParamField path="silent" type="boolean" default="false">
Suppress output if `true`
</ParamField>
## Returns
`Promise<string>` - Command output
## Shell Execution (Linux)
Execute 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 Windows sandb