Skip to content

Commands

The run() method returns a CommandResult object containing the command’s stdout, stderr, and exit code.

from agentbox import Sandbox

sandbox = Sandbox(api_key="ab_xxxxxxxxxxxxxxxxxxxxxxxxx",
template="wemmodr8mb2uk3kn7exw",
timeout=120)

result = sandbox.commands.run('ls -l')
print(result)
from agentbox import AsyncSandbox

sandbox = await AsyncSandbox.create(api_key="ab_xxxxxxxxxxxxxxxxxxxxxxxxx",
template="wemmodr8mb2uk3kn7exw",
timeout=120)

result = await sandbox.commands.run('ls -l')
print(result)