replay-stream
Re-process all events in one or more stream instances through the current version of the handle function. Useful after updating business logic to rebuild state from scratch.
Usage
bash
iwentsourcing replay-stream [pattern] [options]| Argument | Description |
|---|---|
[pattern] | Stream pattern to replay (optional — replays all streams if omitted) |
Options
| Flag | Default | Description |
|---|---|---|
--host <url> | http://localhost:3333 | API host URL |
-t, --tenant <tenant> | default | Tenant to replay |
What It Does
For each matching stream instance, replays all stored events through the latest registered handle functions, rebuilding the state snapshot from zero. The event log is not modified — only the derived state is rebuilt.
Example
bash
# Replay all streams on local dev
iwentsourcing replay-stream
# Replay only the 'personal' stream family
iwentsourcing replay-stream 'personal-$(auth.sub)' --tenant acmeNote: Replay can take a long time for streams with many events.