shell_exec
Execute allow-listed commands in a sandboxed git repository with pagination, configurable timeout, and automated spill for large outputs.
Instructions
Execute an allow-listed command within the sandbox (git project root). Optional cwd must be a relative path from the sandbox root, or an absolute path within the sandbox or a valid git worktree. Supports pagination via limit_bytes and next_cursor (page and cursor are required for pagination). Automatically spills large outputs to file with spill_uri.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cmd | Yes | The command to execute (e.g., 'git', 'npm', 'python') | |
| args | No | Command arguments as an array of strings (e.g., ['status', '--short']) | |
| cwd | No | Relative path from sandbox root, or absolute path within the sandbox or a valid git worktree | |
| timeout_ms | No | Command timeout in milliseconds (deprecated, use timeout_seconds instead) | |
| timeout_seconds | No | Command timeout in seconds (1-600, will be clamped to policy limits) | |
| max_output_bytes | No | Maximum output size in bytes (1000-10M, will be clamped to policy limits) | |
| page | Yes | Pagination configuration. Pagination is always on and hence a required attribute. | |
| on_large_output | No | How to handle large outputs | spill |