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

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).

> List each chart's expressions and scripts with where they are.

List each chart's expressions and scripts with where they are.

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

## Usage

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

Lists each chart's expressions and scripts: kind, line, column and text. Reads one image (`.tai`), one snapshot, one system manifest or SCXML charts, compiled together into one image first. `--segment` picks a snapshot's image, and - reads standard input.

<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.
- **`-k, --kind KIND`**: Keep only the expressions of `KIND`. Repeatable. Values: `condition`, `value`, `location`, `script`, `string`, `content`, `item`, `global-script`.

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 expressions --kind condition order.scxml
```

```text title="output"
# Expressions

## Charts

### Chart 1: order

- **Name**: order

#### Expressions

| Index | Kind | Line | Column | Source |
| --- | --- | --- | --- | --- |
| 3 | condition | 8 | 5 | _event.data.price > 0 |
| 6 | condition | 11 | 5 | total > 0 |
| 9 | condition | 28 | 5 | `attempts < 3` |
```

List the conditions of a chart.

```shell
tinyactors expressions -f xml order.tai
```

```text title="output"
<?xml version="1.0" encoding="UTF-8"?>
<expressions>
  <charts>
    <chart name="order">
      <expressions>
        <expression index="0" kind="value" line="3" column="5" source="0"/>
        <expression index="1" kind="value" line="4" column="5" source="0"/>
        <expression index="2" kind="value" line="5" column="5" source="null"/>
        <expression index="3" kind="condition" line="8" column="5" source="_event.data.price &gt; 0"/>
        <expression index="4" kind="location" line="9" column="7" source="total"/>
        <expression index="5" kind="value" line="9" column="7" source="total + _event.data.price"/>
        <expression index="6" kind="condition" line="11" column="5" source="total &gt; 0"/>
        <expression index="7" kind="location" line="26" column="7" source="charge"/>
        <expression index="8" kind="value" line="26" column="7" source="_event.data.charge"/>
        <expression index="9" kind="condition" line="28" column="5" source="attempts &lt; 3"/>
        <expression index="10" kind="location" line="16" column="7" source="attempts"/>
        <expression index="11" kind="value" line="16" column="7" source="attempts + 1"/>
        <expression index="12" kind="value" line="18" column="9" source="total"/>
        <expression index="13" kind="value" line="36" column="7" source="charge"/>
      </expressions>
    </chart>
    <chart name="payment">
      <expressions>
        <expression index="0" kind="value" line="3" column="5" source="0"/>
      </expressions>
    </chart>
  </charts>
</expressions>
```

List the expressions of an image as XML.

<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

- **[`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 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 inspect`](https://tinyactors.dev/cli/commands/inspect/index.md)**: Show what an image, a snapshot or a blob holds.

## 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/)
