> ## Documentation Index
> Fetch the complete documentation index at: https://piyushvyas.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Composite Actions

> Execute multiple browser steps in a single command with bap act. Fewer commands, fewer tokens, fewer roundtrips.

# Composite Actions

`bap act` is the killer feature of BAP CLI. It batches multiple browser steps into a single command and a single server call.

## Syntax

```
bap act <step1> <step2> <step3> ...
```

Each step follows the format:

```
action:selector=value    (for actions that need a value)
action:selector          (for actions without a value)
```

## Examples

<CodeGroup>
  ```bash Login flow theme={null}
  bap act fill:label:"Email"="user@example.com" \
          fill:label:"Password"="secret" \
          click:role:button:"Sign in"
  ```

  ```bash Accept cookies + navigate theme={null}
  bap act click:text:"Accept" goto:https://example.com/app
  ```

  ```bash Search theme={null}
  bap act fill:role:searchbox:"Search"="query here" press:Enter
  ```

  ```bash Using snapshot refs theme={null}
  bap act fill:e5="user@example.com" fill:e8="pass" click:e12
  ```

  ```bash Using stable refs from observe theme={null}
  bap act fill:@ea91p3r="user@example.com" \
          fill:@ef23k8p="password" \
          click:@ef82k1d
  ```
</CodeGroup>

## Supported Actions

The following actions can be used in composite steps:

| Action    | Syntax                  | Description                    |
| --------- | ----------------------- | ------------------------------ |
| `click`   | `click:selector`        | Click an element               |
| `fill`    | `fill:selector=value`   | Fill an input field            |
| `type`    | `type:text`             | Type text into focused element |
| `press`   | `press:key`             | Press a keyboard key           |
| `select`  | `select:selector=value` | Select a dropdown option       |
| `check`   | `check:selector`        | Check a checkbox               |
| `uncheck` | `uncheck:selector`      | Uncheck a checkbox             |
| `hover`   | `hover:selector`        | Hover over an element          |
| `goto`    | `goto:url`              | Navigate to a URL              |

## Fused Observation

Combine `act` with `--observe` to get the resulting page state in the same server call:

```bash theme={null}
bap act click:role:button:"Submit" --observe
bap act click:e3 --observe --tier=interactive
```

This turns 3 roundtrips (act + observe + process) into 1.

<ParamField path="--observe" type="flag">
  Perform a post-observation after all steps complete. Returns updated page elements.
</ParamField>

<ParamField path="--tier" type="string" default="full">
  Response tier for the fused observation: `full`, `interactive`, or `minimal`.
</ParamField>

## Selector Syntax in Steps

Within composite steps, the parser splits on the first `:` for the action name, then scans right-to-left for an unquoted `=` to separate the selector from the value.

```
fill:role:textbox:"Email"="user@example.com"
|    |                    |
|    selector             value
action
```

<Warning>
  If your value contains `=`, wrap it in quotes: `fill:e5="a=b"`. The parser finds the rightmost
  unquoted `=` to split.
</Warning>

## Comparison

| Approach            | Commands | Server calls | LLM reasoning cycles |
| ------------------- | -------- | ------------ | -------------------- |
| Individual commands | 3        | 3            | 3                    |
| `bap act`           | 1        | 1            | 1                    |
| `bap act --observe` | 1        | 1            | 1 (with page state)  |
