Run Command • AI Agent SDK

run_command: Run a shell command in the sandbox.

run_command

Async

Method

</div>

This is a method of the SandboxProtocol class in the protocols module.

Run a shell command in the sandbox.

Signature

python
async def run_command(command: Union[str, List[str]], limits: Optional[ResourceLimits], env: Optional[Dict[str, str]], working_dir: Optional[str]) -> SandboxResult

Parameters

ParamField Union

Command to run (string or list of args)

ParamField Optional[ResourceLimits]

Resource limits for execution

ParamField Optional

Environment variables

ParamField Optional[str]

Working directory

Returns

ResponseField SandboxResult

Execution result

Source

View on GitHub

praisonaiagents/sandbox/protocols.py at line 276