# runSandboxCommand

```graphql
mutation RunSandboxCommand($sandboxId: ID!, $input: SandboxCommandInput!) {
  runSandboxCommand(sandboxId: $sandboxId, input: $input) {
    stdout
    stderr
    exitCode
  }
}
```

Run a sandbox command. Requires project.sandboxes.manage.

## Arguments

| Name                   | Type                 | Required | Description |
| ---------------------- | -------------------- | -------- | ----------- |
| `sandboxId`            | ID!                  | Yes      |             |
| `input`                | SandboxCommandInput! | Yes      |             |
| `input.command`        | String!              | Yes      |             |
| `input.cwd`            | String               |          |             |
| `input.timeoutSeconds` | Int                  |          |             |
| `input.env`            | StringMap            |          |             |

## Variables

```json
{
  "sandboxId": "string",
  "input": {
    "command": "string"
  }
}
```

## Responses

| Status | Description                                          |
| ------ | ---------------------------------------------------- |
| 200    | The SandboxCommandResult! in data.runSandboxCommand. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation RunSandboxCommand($sandboxId: ID!, $input: SandboxCommandInput!) {\n  runSandboxCommand(sandboxId: $sandboxId, input: $input) {\n    stdout\n    stderr\n    exitCode\n  }\n}",
  "variables": {
    "sandboxId": "string",
    "input": {
      "command": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "runSandboxCommand": {
      "stdout": "string",
      "stderr": "string",
      "exitCode": 0
    }
  }
}
```
