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

# Sandbox host ls

## Overview

Run a simple command through `Sandbox::host()`.
This is the quickest way to verify sandbox execution in your environment.

## Example

```php theme={null}
<?php
require 'examples/boot.php';

use Cognesy\Sandbox\Config\ExecutionPolicy;
use Cognesy\Sandbox\Sandbox;

$policy = ExecutionPolicy::in(__DIR__)
    ->withTimeout(3);

$result = Sandbox::host($policy)->execute(['ls', '-Al']);

echo "Exit: {$result->exitCode()}\n";
echo "--- stdout ---\n";
echo $result->stdout() . "\n";

if ($result->stderr() !== '') {
    echo "--- stderr ---\n";
    echo $result->stderr() . "\n";
}

assert($result->exitCode() === 0, 'ls command should exit with code 0');
assert(!empty($result->stdout()), 'ls command should produce output');
?>
```
