Installation

Terminal
npm install -D replayci
npx replayci [command] [options]

Commands

replayci (default)

Run contracts against a provider. Reads config from .replayci.yml, overridden by CLI flags.

Terminal
npx replayci
npx replayci --provider openai --model gpt-4o-mini
npx replayci --pack packs/my-pack --persist

replayci init

Scaffold a new project with a config file and starter pack. Skips files that already exist.

replayci help

Show help text. Also available as --help or -h.

replayci drift

Run drift detection against the current baseline.

replayci export-bundle

Export a replay bundle for offline verification.

replayci replay-bundle

Replay a previously exported bundle.

Options

Provider & model

FlagDescriptionDefault
--provider <name>LLM provider: openai, anthropic, recordedFrom config
--model <name>Model ID (e.g. gpt-4o-mini)From config
--pack <path>Path to contract pack directorypacks/starter

Execution

FlagDescriptionDefault
--persistWrite run artifacts to diskfalse
--repeat <n>Run N times for determinism proof1
--only_contracts <csv>Filter to specific contract filenamesAll
--jsonForce JSON output (default for non-TTY)Auto-detect

Identity

FlagDescriptionDefault
--tenant_id <id>Tenant identifiert_default
--run_mode <mode>Run mode: manual, scheduled, cimanual

Timeouts & limits

FlagDescriptionDefault
--timeout_ms <ms>Timeout per contract in milliseconds30000
--retry_cap <n>Maximum retry attempts2
--max_contracts <n>Limit number of contracts to runAll

Shadow mode

FlagDescription
--shadow-captureEnable shadow capture for live provider runs
--shadow-provider <name>Shadow provider for comparison
--shadow-model <name>Shadow model for comparison

Environment variables

VariableDescriptionRequired
REPLAYCI_API_KEYAPI key for pushing results to the dashboardFor dashboard push
REPLAYCI_PROVIDER_KEYProvider API key (OpenAI or Anthropic)For live provider runs
REPLAYCI_API_URLOverride API base URLNo
DATABASE_URLPostgreSQL connection stringFor local DB persistence

API keys always come from environment variables — never from .replayci.yml or CLI flags.

Config file

ReplayCI reads .replayci.yml from the project root. CLI flags override config values.

.replayci.yml
pack: "./packs/starter"
provider: openai
model: gpt-4o-mini
persist: false
tenant_id: t_default
run_mode: manual

Resolution order: CLI flags > .replayci.yml > built-in defaults.

Output formats

Pretty (default for TTY)

zsh
  replayci · openai/gpt-4o-mini · 4 contracts

   tool_call              Pass  a3f82c91
   function_call          Pass  b7d104e3
   structured_output      Pass  c9a2f156
   error_handling         Fail  e1b3d478  ← schema_payload

  3/4 passed · 1 failed

  results → https://app.replayci.com/runs/r_8f3a2c

JSON (default for pipes/CI)

Terminal
npx replayci --json | jq '.provider_run.steps[0].state'

Dashboard push

When REPLAYCI_API_KEY is set and a provider run completes, results are automatically pushed to the hosted dashboard.

  • Push is independent of --persist — both can run simultaneously
  • Push failure warns to stderr but does not affect the exit code
  • Override the API URL with REPLAYCI_API_URL for local development

Determinism proof

Terminal
npx replayci --repeat 3

Output includes a determinism_proof object showing whether each step produced identical fingerprints across all runs.

Exit codes

CodeMeaning
0All contracts passed
1One or more contracts failed, or a runtime error occurred
2Drift detection or unknown-rate gate failure

Examples

Terminal
# Initialize a new project
npx replayci init

# Run with defaults from .replayci.yml
npx replayci

# Run against OpenAI with a specific model
npx replayci --provider openai --model gpt-4o-mini

# Run against Anthropic
npx replayci --provider anthropic --model claude-sonnet-4-6

# Run against recorded fixtures (offline, deterministic)
npx replayci --provider recorded

# Run specific contracts only
npx replayci --only_contracts tool_call.yaml,function_call.yaml

# Prove determinism with 3 identical runs
npx replayci --repeat 3

# Force JSON output for CI
npx replayci --json

# Shadow comparison: OpenAI primary, Anthropic shadow
npx replayci --provider openai --model gpt-4o-mini \
  --shadow-capture --shadow-provider anthropic --shadow-model claude-sonnet-4-6

# Show help
npx replayci --help