# List the tracked command executions in a sandbox

Launch stage: Beta

`GET /api/2.0/sandbox-exec/{parent=sandboxes/*}/commands`

Lists the tracked command executions (running and completed) in a sandbox.

API scopes: sandbox

## Path parameters

- `parent` (string, required)
  The sandbox whose commands to list, in the form `sandboxes/{sandbox_id}`.

## Query parameters

- `page_size` (int32, optional)
  Maximum number of commands to return. The server may return fewer.
   If unspecified, the server returns all commands.
- `page_token` (string, optional)
  Page token returned by a previous ListCommands call. Use this to
   retrieve the next page of results.

## Returns

- `commands` (array of object, optional)
  Commands in this page of results.
  - `command_id` (string, optional)
    Stable identifier for this command.
  - `cmd` (string, optional)
    The program that was executed.
  - `args` (array of string, optional)
    Arguments passed to the program.
  - `pid` (int64, optional)
    PID of the spawned process. Absent if the process failed to start.
  - `finished` (boolean, optional)
    Whether the command has finished executing.
  - `exit_code` (int32, optional)
    Process exit code. Only present when finished is true and the process
     exited normally (not killed by signal or failed to start).
- `next_page_token` (string, optional)
  Token to retrieve the next page. Empty when there are no more results.

## Response

```json
{
  "commands": [
    {
      "command_id": "string",
      "cmd": "string",
      "args": [
        "string"
      ],
      "pid": 0,
      "finished": true,
      "exit_code": 0
    }
  ],
  "next_page_token": "string"
}
```

