Commands
The run()
method returns a CommandResult
object containing the command’s stdout, stderr, and exit code.
Sync Sandbox
Section titled “Sync Sandbox”from agentbox import Sandbox
sandbox = Sandbox(api_key="ab_xxxxxxxxxxxxxxxxxxxxxxxxx",
template="wemmodr8mb2uk3kn7exw",
timeout=120)
result = sandbox.commands.run('ls -l')
print(result)
Async Sandbox
Section titled “Async Sandbox”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)