Skip to content

vix replay

vix replay replays a previously recorded Vix execution.

It helps you reproduce a run that failed, crashed, or behaved unexpectedly. Use it when you want to rerun the same command without guessing what happened.

vix run does not record replay data by default. To create a replay record, run your command with --replay.

Usage

bash
vix replay [id|last|failed] [options] [-- app-args...]

What it does

vix replay loads a recorded execution from .vix/runs/ and runs it again with the stored context.

It can:

  • replay the latest recorded run
  • replay the latest failed run
  • replay a specific run by id
  • show recorded run details
  • list previous runs
  • clean recorded replay data
  • append extra runtime arguments
  • add temporary environment variables during replay

Recording a run

Replay records are created only when vix run is executed with --replay.

bash
# Record a project run
vix run api --replay

# Record a built executable run
vix run ./build-ninja/api --replay

# Record a manifest run
vix run app.vix --replay

# Record a single-file C++ run
vix run main.cpp --replay

Without --replay, vix run runs normally and does not create .vix/runs/.

bash
vix run api
vix run main.cpp

These commands do not create replay data.

Basic usage

bash
# Replay the latest recorded run
vix replay

# Replay the latest run explicitly
vix replay last

# Replay the latest failed run
vix replay failed

# Replay a specific run
vix replay 2026-05-05-18-42-11-a91f

When to use it

Use vix replay when an execution fails and you want to reproduce it quickly.

Typical workflow:

bash
vix run api --replay
# something fails

vix replay failed

Or:

bash
vix run server.cpp --replay
# unexpected result

vix replay last

Why it matters

Without replay, you often need to remember: which command was used, which directory it ran from, which arguments were passed, which environment variables were active, which output was produced, and whether the run failed, crashed, or was interrupted.

vix replay keeps that context in a recorded run.

Difference between vix run, vix dev, and vix replay

CommandBest forRecords/replays context
vix runmanual runrecords only with --replay
vix devactive developmentrecords development executions when enabled
vix replayreproducing a previous runreplays recorded execution

vix replay does not replace vix run or vix dev. It uses recorded executions created by replay-enabled runs.

Replay the latest run

bash
vix replay

Equivalent to:

bash
vix replay last

You can also use:

bash
vix replay latest

Replay the latest failed run

bash
vix replay failed

You can also use:

bash
vix replay fail

This is useful when several successful runs happened before or after a failure.

Replay a specific run

Each recorded run has an id:

bash
vix replay 2026-05-05-18-42-11-a91f

Run ids are stored under .vix/runs/.

List recorded runs

bash
vix replay list

# Show only failed runs
vix replay list --failed

# Show only successful runs
vix replay list --success

# Show only interrupted runs
vix replay list --interrupted

# Limit the number of results
vix replay list --limit 10

Show a recorded run

bash
# Show the latest run
vix replay show last

# Show the latest failed run
vix replay show failed

# Show a specific run
vix replay show 2026-05-05-18-42-11-a91f

This prints the recorded metadata, command, status, duration, logs, and replay hint.

Dry run

Use --dry-run to print the replay command without executing it:

bash
vix replay last --dry-run

Useful when you want to inspect what will be replayed before running it.

Pass extra app arguments

Arguments after -- are appended to the replay command:

bash
vix replay last -- --port 8080

Add environment variables

bash
vix replay last --env VIX_LOG_LEVEL=debug

Multiple variables:

bash
vix replay last --env VIX_LOG_LEVEL=debug --env APP_ENV=local

Use another replay directory

By default, vix replay reads from .vix/runs/ in the current directory.

Use --dir or --cwd to read from another location:

bash
vix replay last --dir ./api
vix replay list --cwd ./api

Clean replay data

bash
vix replay clean

Removes recorded replay runs from .vix/runs/.

Recorded files

A recorded run is stored as:

.vix/runs/<id>/
  run.json
  stdout.log
  stderr.log
  combined.log

The latest marker stores the most recent run id:

.vix/runs/latest

Options

OptionDescription
--dry-runPrint the replay command without executing it
--summaryPrint the record summary before replaying
--no-summaryDo not print the record summary
--dir, --cwdUse another directory containing .vix/runs
--env KEY=VALUEAdd an environment variable during replay
--Append remaining arguments to the replay command
-h, --helpShow command help

Recording option on vix run

OptionDescription
--replayRecord this vix run execution under .vix/runs/

Example:

bash
vix run api --replay
vix run ./build-ninja/api --replay
vix run app.vix --replay
vix run main.cpp --replay

List options

OptionDescription
--allShow all replay runs
--failed, --failShow failed replay runs
--success, --okShow successful replay runs
--interrupted, --interruptShow interrupted replay runs
--limit <n>Limit number of rows
--dir, --cwd <path>Use another directory containing .vix/runs

Common workflows

bash
# Record and replay a project run
vix run api --replay
vix replay last

# Record and replay a single-file C++ run
vix run main.cpp --replay
vix replay last

# Replay the latest failed run
vix replay failed

# Inspect the latest run before replaying
vix replay show last
vix replay last

# List failures
vix replay list --failed

# Replay with debug logs
vix replay failed --env VIX_LOG_LEVEL=debug

# Print the replay command only
vix replay last --dry-run

# Clean old replay data
vix replay clean

Common mistakes

Expecting vix run to record automatically

Wrong:

bash
vix run api
vix replay last

Correct:

bash
vix run api --replay
vix replay last

vix run does not create replay records by default. Use --replay when you want the execution to be recorded.

Running replay from the wrong directory

Wrong:

bash
cd ..
vix replay last

Correct:

bash
cd api
vix replay last

Or:

bash
vix replay last --dir ./api

vix replay reads .vix/runs/ from the current directory unless --dir or --cwd is provided.

Forgetting that failed means the latest failed run

bash
vix replay failed

This does not replay every failed run. It replays only the latest failed run.

To list all failures:

bash
vix replay list --failed

Passing extra arguments without --

Wrong:

bash
vix replay last --port 8080

Correct:

bash
vix replay last -- --port 8080

The -- separates replay options from arguments appended to the replayed command.

CommandPurpose
vix runBuild and run manually
vix devStart dev server with auto-reload
vix buildConfigure and compile
vix checkValidate build, tests, runtime, and sanitizers
vix testsRun tests

Last updated: