<!-- enhance-docs page=reference/cli/canvas/capture -->
<!-- enhance-docs release-sha256=8a804cfc9a6fc6b942b8daf6a82266ad6e308291ae4351abee3346bc696d1258 -->

# enhance-dev canvas capture

```text
enhance-dev canvas capture [options]
```

## Arguments

This command takes no positional arguments.

## Options

| Option | Required | Default | Meaning |
| --- | --- | --- | --- |
| `--input <json-or-@path>` | Yes | None | Canvas reference, base version and explicit native authoring request. |
| `--client-token <uuid>` | Yes | None | Stable UUID to reuse when retrying the exact same mutation. |

## Input

This command presents the capability `canvas.capture`. It has write effect and single idempotency.

<details class="reference-schema">
<summary>Show complete input JSON Schema</summary>

```json
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canvasRef":{"type":"string","minLength":1},"waitMs":{"default":1500,"description":"Additional local polling after the server returns an active job; render creation retains its existing bounded HTTP deadline.","type":"integer","minimum":0,"maximum":5000},"baseVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"source":{"type":"object","properties":{"kind":{"type":"string","const":"recording"},"recordingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"atMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","recordingId","atMs"],"additionalProperties":false},"previewJobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The successful canvas_render job whose pixels you inspected at this exact recording time and canvas version."},"placement":{"type":"object","properties":{"kind":{"type":"string","const":"below-source"}},"required":["kind"],"additionalProperties":false}},"required":["canvasRef","baseVersion","source","previewJobId","placement"],"additionalProperties":false}
```
</details>


## Output

This command writes JSON records to standard output. Returns a typed canvas.capture result from the Enhance API without transport-specific prose.

<details class="reference-schema">
<summary>Show complete output JSON Schema</summary>

```json
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"kind":{"type":"string","const":"canvas-render"},"canvasId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","canvasId","jobId"],"additionalProperties":false},"state":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","expired"]},"requestedVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"source":{"type":"object","properties":{"kind":{"type":"string","const":"recording"},"recordingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"atMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","recordingId","atMs"],"additionalProperties":false},"attachment":{"type":"string","enum":["pending","committed","not_confirmed"]},"result":{"anyOf":[{"type":"object","properties":{"recordingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"atMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"screenId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"screenNodeId":{"type":"string","minLength":1},"viewport":{"type":"object","properties":{"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["width","height"],"additionalProperties":false},"box":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"required":["x","y","width","height"],"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"alreadyPresent":{"type":"boolean"}},"required":["recordingId","atMs","screenId","screenNodeId","viewport","box","version","alreadyPresent"],"additionalProperties":false},{"type":"null"}]},"failure":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["VERSION_CHANGED","TARGET_NOT_FOUND","TARGET_INVALID","OUTPUT_TOO_LARGE","READINESS_TIMEOUT","SOURCE_FAILED","BROWSER_CRASH","CAPTURE_FAILED","CONVERSION_FAILED","PREPARATION_FAILED","UPLOAD_FAILED","WORKER_UNAVAILABLE","CANCELLED","EXPIRED","INTERNAL"]},"phase":{"type":"string","enum":["queued","claimed","grant","navigate","document","sources","fonts","layout","target","capture","serialize","compile","commit","upload","complete"]},"message":{"type":"string","minLength":1,"maxLength":500},"retryable":{"type":"boolean"},"sourceId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["reason","phase","message","retryable","sourceId"],"additionalProperties":false},{"type":"null"}]},"warningCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}}},"required":["operation","state","requestedVersion","source","attachment","result","failure","warningCount","warnings"],"additionalProperties":false}
```
</details>


## Examples

```bash
enhance-dev canvas capture --input <json-or-@path> --client-token <uuid>
```

<details class="reference-schema">
<summary>Show example input</summary>

```json
{
 "canvasRef": "00000000-0000-4000-8000-000000000010",
 "baseVersion": 1,
 "source": {
  "kind": "recording",
  "recordingId": "00000000-0000-4000-8000-000000000010",
  "atMs": 500
 },
 "previewJobId": "00000000-0000-4000-8000-000000000010",
 "placement": {
  "kind": "below-source"
 },
 "waitMs": 1500
}
```
</details>

<details class="reference-schema">
<summary>Show example output</summary>

```json
{
 "operation": {
  "kind": "canvas-render",
  "canvasId": "00000000-0000-4000-8000-000000000010",
  "jobId": "00000000-0000-4000-8000-000000000010"
 },
 "state": "queued",
 "requestedVersion": 1,
 "source": {
  "kind": "recording",
  "recordingId": "00000000-0000-4000-8000-000000000010",
  "atMs": 500
 },
 "attachment": "pending",
 "result": null,
 "failure": null,
 "warningCount": 0,
 "warnings": []
}
```
</details>

## Exit behaviour

| Exit code | Meaning |
| --- | --- |
| `0` | The command succeeded. |
| `1` | The command failed for another reason (`INTERNAL`). A write may have an unknown outcome. |
| `2` | The command line was malformed. Nothing ran. |
| `3` | The API refused the input (`BAD_REQUEST`). |
| `4` | The credential is missing or expired (`UNAUTHORIZED`). |
| `5` | The API refused the request (`FORBIDDEN`, `NOT_FOUND`, `CONFLICT`, `RATE_LIMITED`). |
| `6` | A batch finished only in part. Retry with the same `--client-token`. |

## Versions

Minimum tested versions: Enhance CLI and MCP runtime 0.1.40, plugin 1.0.38, Node.js 24. No older floor is published.
