CLI for Agents

Replay Requests

Re-send any captured request to your local server with the replay command — the same replay the desktop app's inspector has. It reads the request from the capture log and sends it straight to your local target, with no tunnel round-trip and no credits spent. Perfect for re-testing a webhook handler after a fix without waiting for the provider to fire again.

bash
# Re-send the latest captured request
npx otterkit replay agent-a1b2c3d4

# Re-send request #3 (1 = oldest, -1 = latest)
npx otterkit replay agent-a1b2c3d4 --index 3

# Explicit local target (for webhook captures or stopped tunnels)
npx otterkit replay agent-a1b2c3d4 --target 127.0.0.1:3000

# Machine-readable response for agents (body base64-encoded)
npx otterkit replay agent-a1b2c3d4 --json

The target defaults to the running daemon's host:port for that subdomain, so after otterkit tunnel 3000 --log --daemon a plain otterkit replay <subdomain> just works. You can also tweak the request before re-sending:

bash
npx otterkit replay agent-a1b2c3d4 --method PUT --path /v2/hook \
  -H "X-Debug: 1" --body '{"event":"payment.failed"}'

# Edit individual JSON body fields instead of replacing the whole body
# (repeatable; values parse as JSON, so amounts stay numbers)
npx otterkit replay agent-a1b2c3d4 --set data.amount=999 --set data.livemode=false
The replayed exchange is appended to the capture log — including the response status, headers, and body — so it shows up in otterkit inspect alongside the original, and in --har exports with both sides of the exchange.