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

# replay watch

> Watch workflow files and automatically re-run on changes.

# `replay watch`

Watch one or more workflow files and automatically re-run them when changes are detected.

## Usage

```bash theme={null}
replay watch <workflow.yaml>... [flags]
```

## How It Works

1. Replay watches the directories containing the specified files using `fsnotify`
2. When a file is modified or created, Replay waits for the debounce period (no further changes)
3. After the debounce, it re-runs all watched workflows
4. Press `Ctrl+C` to stop

## Flags

| Flag            | Alias | Default | Description                                         |
| --------------- | ----- | ------- | --------------------------------------------------- |
| `--debounce`    |       | `500ms` | Debounce duration for coalescing rapid file changes |
| `--concurrency` | `-c`  | `1`     | Number of concurrent workflow executions            |
| `--fail-fast`   |       | `false` | Stop execution on first failure                     |
| `--profile`     |       | `""`    | Config profile to use                               |
| `--config`      |       | `""`    | Path to config file                                 |
| `--debug`       | `-d`  | `false` | Enable debug logging                                |

## Example

```bash theme={null}
# Watch a single workflow
replay watch workflow.yaml

# Watch multiple workflows with short debounce
replay watch tests/*.yaml --debounce 200ms

# Watch and run in parallel
replay watch tests/*.yaml --concurrency 4 --debounce 1s
```

## Use Case

The watch command is ideal for test-driven development. Keep a terminal open with `replay watch` running, edit your workflow file, and see results instantly:

```
Watching 3 file(s) for changes (debounce: 500ms)...
  auth.yaml
  catalog.yaml
  checkout.yaml
Press Ctrl+C to stop.

--- File changed: auth.yaml ---
🚀 Starting workflow: login-flow
...
✨ Workflow login-flow finished: SUCCESS (total 345ms)
Watching for changes...
```
