Run a command
execRun a shell command (bash) in the project's preview workspace, in /workspace by default, as the project's user, with DATABASE_URL and the preview secrets set. Use it for installs, builds, tests, scripts and git. Waits up to timeout seconds (default 60, max 300); with background: true (or a longer timeout) it returns a job id at once and the output is followed with the job tool. Processes the command leaves running are ended when it finishes: long-running servers belong in services.json (service tool).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"command": "<command>"
},
"name": "exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory, e.g. /workspace/app. | |
| command | Yes | ||
| project | Yes | Project slug or id. | |
| timeout | No | Seconds before the command is stopped: default 60, or 3600 with background. | |
| read_only | No | true for a command that only looks (ls, grep, git log, cat): it runs while another of the user's AIs is working here, without holding the project. It isn't enforced: never use it for a command that changes anything. | |
| background | No | ||
| idempotency_key | No | Any unique string; repeating a call with the same key does not repeat its effect. |