<!-- https://tinyactors.dev/cli/commands/inspect/ -->
# tinyactors inspect

Kind: reference. For: [Workflow developer who tests](https://tinyactors.dev/audiences/workflow-tester.xml), [Agent-platform engineer](https://tinyactors.dev/audiences/agent-platform.xml).
Voice: [Reference](https://tinyactors.dev/voices/reference.xml).

> Show what an image, a snapshot or a blob holds.

Show what an image, a snapshot or a blob holds.

<a id="usage"></a>

## Usage

```shell
tinyactors inspect [options] INPUT...
```

Shows an image's sections, charts and boot actors; it reads its inputs as the other commands do. Shows a snapshot's format, system, time, segments with their images and actors. Shows the datamodels' state of a snapshot too, decoded when it is CBOR. Shows the session a hibernation or export blob holds, the image it was written with and who can wake it. Shows a blob's datamodel state, and its chart and configuration when the image follows it: an image, charts or a snapshot.

<a id="options"></a>

## Options

- **`-W, --warnings-as-errors`**: Refuse a chart that compiles with a warning.
- **`-I, --include DIR`**: Search `DIR` for a src that is not beside the file naming it, in the order given. Repeatable.
- **`-c, --chart NAME`**: Look at the chart named `NAME` only. Repeatable.
- **`-s, --segment N`**: Read the image that segment N of a snapshot runs. Default: the newest live segment.

Configure output formats like `-f json` using the [shared options on the command reference](https://tinyactors.dev/cli/commands/index.md#program-options).

<a id="examples"></a>

## Examples

```shell
tinyactors inspect order.tai
```

```text title="output"
# Inspect

- **From**: image
- **Bytes**: 3552
- **Format**: 1
- **Hash**: b256b6cbfab69138
- **Charts**: 2
- **Boot actors**: 1
- **Event names**: 22

## Sections

| Section | Offset | Bytes | Records |
| --- | --- | --- | --- |
| strings | 272 | 860 | 860 |
| charts | 1136 | 192 | 2 |
| states | 1328 | 704 | 11 |
| transitions | 2032 | 416 | 13 |
| words | 2448 | 192 | 48 |
| code | 2640 | 108 | 27 |
| expressions | 2752 | 240 | 15 |
| captures | 2992 | 40 | 2 |
| sends | 3032 | 112 | 2 |
| invokes | 3144 | 0 | 0 |
| data | 3144 | 48 | 4 |
| eventNames | 3192 | 352 | 22 |
| bootActors | 3544 | 8 | 1 |

## Charts

| Index | Name | Source | Datamodel | Binding | States | Transitions | Data | Expressions | Sends | Invokes | Code words |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | order | order.scxml | ecmascript | early | 6 | 8 | 3 | 14 | 2 | 0 | 27 |
| 1 | payment | payment.scxml | ecmascript | early | 5 | 5 | 1 | 1 | 0 | 0 | 0 |

## Boot actors

| Name | Chart |
| --- | --- |
| order | order |
```

Show what an image holds.

```shell
tinyactors inspect system.xml
```

```text title="output"
# Inspect

- **From**: system manifest
- **Bytes**: 3568
- **Format**: 1
- **Hash**: 1c8ca2cc7138f14e
- **Charts**: 2
- **Boot actors**: 1
- **Event names**: 22

## Sections

| Section | Offset | Bytes | Records |
| --- | --- | --- | --- |
| strings | 272 | 876 | 876 |
| charts | 1152 | 192 | 2 |
| states | 1344 | 704 | 11 |
| transitions | 2048 | 416 | 13 |
| words | 2464 | 192 | 48 |
| code | 2656 | 108 | 27 |
| expressions | 2768 | 240 | 15 |
| captures | 3008 | 40 | 2 |
| sends | 3048 | 112 | 2 |
| invokes | 3160 | 0 | 0 |
| data | 3160 | 48 | 4 |
| eventNames | 3208 | 352 | 22 |
| bootActors | 3560 | 8 | 1 |

## Charts

| Index | Name | Source | Datamodel | Binding | States | Transitions | Data | Expressions | Sends | Invokes | Code words |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | order | order.scxml | ecmascript | early | 6 | 8 | 3 | 14 | 2 | 0 | 27 |
| 1 | payment | payment.scxml | ecmascript | early | 5 | 5 | 1 | 1 | 0 | 0 | 0 |

## Boot actors

| Name | Chart |
| --- | --- |
| first-order | order |
```

Compile a system manifest and show its image.

```shell
tinyactors inspect --format json order.scxml
```

```text title="output"
{
  "from": "charts",
  "bytes": 2720,
  "format": 1,
  "hash": "5e66ab57693504aa",
  "charts": 1,
  "bootActors": 1,
  "eventNames": 18,
  "sections": [
    {
      "section": "strings",
      "offset": 272,
      "bytes": 748,
      "records": 748
    },
    {
      "section": "charts",
      "offset": 1024,
      "bytes": 96,
      "records": 1
    },
    {
      "section": "states",
      "offset": 1120,
      "bytes": 384,
      "records": 6
    },
    {
      "section": "transitions",
      "offset": 1504,
      "bytes": 256,
      "records": 8
    },
    {
      "section": "words",
      "offset": 1760,
      "bytes": 136,
      "records": 34
    },
    {
      "section": "code",
      "offset": 1896,
      "bytes": 108,
      "records": 27
    },
    {
      "section": "expressions",
      "offset": 2008,
      "bytes": 224,
      "records": 14
    },
    {
      "section": "captures",
      "offset": 2232,
      "bytes": 40,
      "records": 2
    },
    {
      "section": "sends",
      "offset": 2272,
      "bytes": 112,
      "records": 2
    },
    {
      "section": "invokes",
      "offset": 2384,
      "bytes": 0,
      "records": 0
    },
    {
      "section": "data",
      "offset": 2384,
      "bytes": 36,
      "records": 3
    },
    {
      "section": "eventNames",
      "offset": 2424,
      "bytes": 288,
      "records": 18
    },
    {
      "section": "bootActors",
      "offset": 2712,
      "bytes": 8,
      "records": 1
    }
  ],
  "charts": [
    {
      "index": 0,
      "name": "order",
      "source": "order.scxml",
      "datamodel": "ecmascript",
      "binding": "early",
      "states": 6,
      "transitions": 8,
      "data": 3,
      "expressions": 14,
      "sends": 2,
      "invokes": 0,
      "codeWords": 27
    }
  ],
  "bootActors": [
    {
      "name": "order",
      "chart": "order"
    }
  ]
}
```

Compile a chart and show its image as JSON.

```shell
tinyactors inspect shop.snapshot
```

```text title="output"
# Inspect

- **From**: snapshot
- **Bytes**: 626112
- **Format**: 4
- **Host format**: 4
- **Library**: 0.5.0
- **Layout ID**: 2eeec427153eedc3
- **This layout**: yes
- **System ID**: shop
- **Time**: 10000
- **Ticks per second**: 1000
- **Identity**: 000000007952af3e
- **Restored**: yes

## Segments

| Index | Live | Image hash | Image bytes | Charts | Actors | Hibernated |
| --- | --- | --- | --- | --- | --- | --- |
| 0 | yes | 1c8ca2cc7138f14e | 3568 | order, payment | 15 | 1 |
| 1 | yes | fbce6399f9cf5b5b | 2984 | order | 1 | 0 |

- **Actors**: 16
- **Hibernated**: 1

## Datamodel state

- **Label**: tinyactors-run
- **Bytes**: 2479
- **Encoding**: cbor
- **Value**: `{"quickjs":h'1c87eae1f11901026901145f73657373696f6e6964010a5f6e616d65011a5f696f70726f636573736f7273015e687474703a2f2f7777772e77332e6f72672f54522f7363786d6c2f235343584d4c4576656e7450726f636573736f7201106c6f636174696f6e010a7363786d6c01107061796d656e7473010a746f74616c0110617474656d707473010c636861726765010c5f6576656e74ba010874797065010c73656e646964010c6f726967696e01146f726967696e747970650110696e766f6b6569640108646174610106736b75010a7072696365010c726566756e64010270010274010272080402090f09060506072031633863613263633731333866313465050008070407023306070e6f726465722d330808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f330e14051008010c07001205d80414050216070a63685f38331808071a07126368617267652e6f6b1c071065787465726e616c1e070670617920022202240226080116070a63685f383302050009060508072031633863613263633731333866313465050008070407023406070e6f726465722d340808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f340e140c1008010c07001205a00614050216070a63685f38341808071a07126368617267652e6f6b1c071065787465726e616c1e070670617920022202240226080116070a63685f38340205000906050a072031633863613263633731333866313465050008070407023506070e6f726465722d350808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f350e14131008010c07001205e80714050216070a63685f38351808071a07126368617267652e6f6b1c071065787465726e616c1e070670617920022202240226080116070a63685f38350205000906050c072031633863613263633731333866313465050008070407023606070e6f726465722d360808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f360e141a1008010c07001205b00914050216011808071a0710636865636b6f75741c071065787465726e616c1e0220022202240226020205000906050e072031633863613263633731333866313465050008070407023706070e6f726465722d370808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f370e14201008010c07001205f80a14050216011808071a0710636865636b6f75741c071065787465726e616c1e02200222022402260202050009060510072031633863613263633731333866313465050008070407023806070e6f726465722d380808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f380e14261008010c07001205c00c14050216011808071a0710636865636b6f75741c071065787465726e616c1e02200222022402260202050009060512072031633863613263633731333866313465050008070407023906070e6f726465722d390808030a08010c073674696e796163746f72733a2f2f73686f702f235f7363786d6c5f390e142c1008010c07001205880e14050216011808071a0710636865636b6f75741c071065787465726e616c1e022002220224022602020500090605140720316338636132636337313338663134650500080704070431300607106f726465722d31300808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31300e14321008010c07001205d00f14050216011808071a0710636865636b6f75741c071065787465726e616c1e022002220224022602020500090605160720316338636132636337313338663134650500080704070431310607106f726465722d31310808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31310e14381008010c07001205981114050016011808071a07146974656d2e61646465641c071065787465726e616c1e0220022202240226080228070670656e2a059811020500090605180720316338636132636337313338663134650500080704070431320607106f726465722d31320808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31320e143f1008010c07001205e01214050016011808071a07146974656d2e61646465641c071065787465726e616c1e0220022202240226080228070670656e2a05e0120205000906051a0720316338636132636337313338663134650500080704070431330607106f726465722d31330808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31330e14461008010c07001205a81414050016011808071a07146974656d2e61646465641c071065787465726e616c1e0220022202240226080228070670656e2a05a8140205000906051c0720316338636132636337313338663134650500080704070431340607106f726465722d31340808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31340e144d1008010c07001205f01514050016011808071a07146974656d2e61646465641c071065787465726e616c1e0220022202240226080228070670656e2a05f0150205000906051e0720316338636132636337313338663134650500080704070431350607106f726465722d31350808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31350e14541008010c07001205b81714050016011808071a07146974656d2e61646465641c071065787465726e616c1e0220022202240226080228070670656e2a05b817020500090605200720316338636132636337313338663134650500080704070431360607106f726465722d31360808030a08010c073874696e796163746f72733a2f2f73686f702f235f7363786d6c5f31360e145b1008010c07001205801914050016011808071a07146974656d2e61646465641c071065787465726e616c1e0220022202240226080228070670656e2a0580190205000906052807206662636536333939663963663562356205000807040714343239343936373239370607106f726465722d32310808030a08010c074874696e796163746f72733a2f2f73686f702f235f7363786d6c5f343239343936373239370e14621008010c070012050014050016012c010205022e09090903050e05021408090305100502140f0903051205021416090305160502143b09030518050214420903051a050214490903051c050214500903051e05021457090305200502145e300900320a09c15c0289ec2d0a9100',"wallNs":10000000000}`
```

Show what a snapshot holds.

```shell
tinyactors inspect order-17.blob shop.snapshot
```

```text title="output"
# Inspect

- **From**: hibernation blob
- **Bytes**: 290
- **Format**: 5
- **Readable**: yes
- **Session**: 17
- **Image hash**: 1c8ca2cc7138f14e
- **Image matches**: yes
- **Identity**: 000000007952af3e
- **Wakes**: only in the host that hibernated it, or a host restored from its snapshot: one of this identity, running this image
- **Wakes in that snapshot**: yes

## Sessions

### Session 1: order

- **Session**: 17
- **Chart index**: 0
- **Chart**: order
- **Macrosteps**: 2

#### Configuration

- open

#### Delayed

_none_

#### Datamodel

- **Bytes**: 166
- **Encoding**: opaque
- **Note**: not one CBOR item: the datamodel's own encoding (the ECMAScript datamodel's is quickjs's), which only that datamodel reads
```

Show a blob with its chart and configuration from a snapshot.

<a id="exit-status"></a>

## Exit status

- **`1`**: An input is refused: it does not compile or verify, or it is damaged or of an unknown format.
- **`3`**: A file cannot be read or written, or memory runs out.

<a id="see"></a>

## Related pages

- [Offline snapshots](https://tinyactors.dev/cli/guides/snapshots/index.md)
- **[`tinyactors states`](https://tinyactors.dev/cli/commands/states/index.md)**: List each chart's states as a tree in document order.
- **[`tinyactors transitions`](https://tinyactors.dev/cli/commands/transitions/index.md)**: List each chart's transitions with events, conditions and targets.
- **[`tinyactors events`](https://tinyactors.dev/cli/commands/events/index.md)**: List every event name and the transitions, raises and sends using it.
- **[`tinyactors data`](https://tinyactors.dev/cli/commands/data/index.md)**: List each chart's data declarations.
- **[`tinyactors expressions`](https://tinyactors.dev/cli/commands/expressions/index.md)**: List each chart's expressions and scripts with where they are.
- **[`tinyactors path`](https://tinyactors.dev/cli/commands/path/index.md)**: Find the shortest path to a state: events, conditions and transitions.
- **[`tinyactors graph`](https://tinyactors.dev/cli/commands/graph/index.md)**: Draw each chart, or list its boxes and edges.
- **[`tinyactors disassemble`](https://tinyactors.dev/cli/commands/disassemble/index.md)**: List each chart's executable content instruction by instruction.
- **[`tinyactors actors`](https://tinyactors.dev/cli/commands/actors/index.md)**: List every actor of a snapshot with its state and queues.

## Commands

- [tinyactors compile](https://tinyactors.dev/cli/commands/compile/)
- [tinyactors check](https://tinyactors.dev/cli/commands/check/)
- [tinyactors inspect](https://tinyactors.dev/cli/commands/inspect/)
- [tinyactors states](https://tinyactors.dev/cli/commands/states/)
- [tinyactors transitions](https://tinyactors.dev/cli/commands/transitions/)
- [tinyactors events](https://tinyactors.dev/cli/commands/events/)
- [tinyactors data](https://tinyactors.dev/cli/commands/data/)
- [tinyactors expressions](https://tinyactors.dev/cli/commands/expressions/)
- [tinyactors disassemble](https://tinyactors.dev/cli/commands/disassemble/)
- [tinyactors graph](https://tinyactors.dev/cli/commands/graph/)
- [tinyactors diff](https://tinyactors.dev/cli/commands/diff/)
- [tinyactors lint](https://tinyactors.dev/cli/commands/lint/)
- [tinyactors path](https://tinyactors.dev/cli/commands/path/)
- [tinyactors fmt](https://tinyactors.dev/cli/commands/fmt/)
- [tinyactors actors](https://tinyactors.dev/cli/commands/actors/)
- [tinyactors run](https://tinyactors.dev/cli/commands/run/)
- [tinyactors help](https://tinyactors.dev/cli/commands/help/)
- [tinyactors version](https://tinyactors.dev/cli/commands/version/)
