> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Command • AI Agent SDK

> run_command: Run a shell command in the sandbox.

# run\_command

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**SandboxProtocol**](../classes/SandboxProtocol) class in the [**protocols**](../modules/protocols) module.

Run a shell command in the sandbox.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def run_command(command: Union[str, List[str]], limits: Optional[ResourceLimits], env: Optional[Dict[str, str]], working_dir: Optional[str]) -> SandboxResult
```

## Parameters

<ParamField query="command" type="Union" required={true}>
  Command to run (string or list of args)
</ParamField>

<ParamField query="limits" type="Optional" required={false}>
  Resource limits for execution
</ParamField>

<ParamField query="env" type="Optional" required={false}>
  Environment variables
</ParamField>

<ParamField query="working_dir" type="Optional" required={false}>
  Working directory
</ParamField>

### Returns

<ResponseField name="Returns" type="SandboxResult">
  Execution result
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/sandbox/protocols.py#L275">
  `praisonaiagents/sandbox/protocols.py` at line 275
</Card>
