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

# royaltyport project exec

> Execute one or more bash commands in a project's sandbox.

```bash theme={null}
royaltyport project exec <project_id> <commands...>
```

Executes one or more bash commands sequentially in a project's sandbox. Commands run with the sandbox workspace root as the working directory. When multiple commands are provided, the sandbox instance is reused across all commands for faster batch execution.

***

## Arguments

| Argument     | Required | Description                                     |
| ------------ | -------- | ----------------------------------------------- |
| `project_id` | Yes      | The project UUID                                |
| `commands`   | Yes      | One or more bash commands to run in the sandbox |

***

## Options

| Option       | Description                                      |
| ------------ | ------------------------------------------------ |
| `--parallel` | Run commands in parallel instead of sequentially |

***

## Behavior

* **Single command:** stdout and stderr are written directly to their respective streams (no header)
* **Multiple commands:** each result is prefixed with a `> {command}` header (dimmed) before its output
* **`--parallel`:** all commands run concurrently; results are printed in the order they were given
* The process exits with the last non-zero exit code, or `0` if all commands succeed
* Suitable for scripting and AI agent tool use

***

## Examples

Single command:

```bash theme={null}
royaltyport project exec $PROJECT_ID "ls contracts/"
```

Batch execution:

```bash theme={null}
royaltyport project exec $PROJECT_ID "ls contracts/" "cat stats.yaml"
```

Output for batch execution:

```
> ls contracts/
contract_123/
contract_456/

> cat stats.yaml
total_contracts: 2
...
```

```bash theme={null}
# Search for an entity by name
royaltyport project exec $PROJECT_ID "grep -rl 'Sony Music' entities/"
```

```bash theme={null}
# Read a contract's extracted royalties
royaltyport project exec $PROJECT_ID "cat contracts/contract_123/extracted/royalties.yaml"
```
