Skip to content

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]
ArgumentDescription
[pattern]Stream pattern to replay (optional — replays all streams if omitted)

Options ​

FlagDefaultDescription
--host <url>http://localhost:3333API host URL
-t, --tenant <tenant>defaultTenant 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 acme

Note: Replay can take a long time for streams with many events.