@agentrewind/cli
v0.1.4
Published
AgentRewind command-line tools for inspecting, diffing, packing, and unpacking sessions.
Maintainers
Readme
@agentrewind/cli
Command-line inspection and packaging tools for AgentRewind sessions.
The umbrella package @agentrewind/sdk installs the same binaries, so most users do
not need to install this package directly.
Commands
agentrewind quickstart [openai|openai-compatible|openrouter|anthropic]
agentrewind quickstart openai --format ts
agentrewind quickstart openai --out agentrewind-openai.ts
agentrewind list [.rewind]
agentrewind list [.rewind] --json
agentrewind doctor <session>
agentrewind doctor <session-id> --store .rewind
agentrewind doctor latest --store .rewind
agentrewind inspect <session>
agentrewind timeline <session> --kind model_call --site <name>
agentrewind inspect <session> --json
agentrewind context <session>
agentrewind prompt <session> --site <name>
agentrewind context <session> --step <n>
agentrewind context <session> --site <name>
agentrewind context <session> --json
agentrewind diff <session>
agentrewind diff <session> --from <a> --to <b>
agentrewind diff <session> --from-site <a> --to-site <b>
agentrewind fork <session> --site <name> --system "Updated system prompt"
agentrewind fork latest --store .rewind --step <n> --model <model-id>
agentrewind tool <session>
agentrewind tool <session> --name <tool>
agentrewind tool <session> --step <n>
agentrewind tool <session> --json
agentrewind entropy <session>
agentrewind entropy <session> --source uuid
agentrewind entropy <session> --step <n>
agentrewind pack <session> <out.rewind>
agentrewind unpack <out.rewind> <dir>Alias:
arw inspect <session>Notes
quickstartprints install commands and a minimal TypeScript record/replay starter for the selected provider. Use--manager pnpm,--manager yarn, or--manager bunfor a different install command. Use--format tsto print raw TypeScript, or--out <file>to write a starter file. Starters usedefineHarness()so TypeScript infers the harness result without a manual generic annotation, and they validate required environment variables before recording. They also format validation, record, and replay failures withexplainRewindError()and a known session path.--outrefuses to overwrite existing files unless--forceis passed.listshows the sessions inside a store such as.rewind, including each session id, provider, origin, model/tool/entropy counts, token usage, and full session path. Use it when you know the store directory but not the exact.rewind/<session-id>path.lsis an alias, and--jsonis available for scripts.- Single-session commands (
doctor,inspect,context,diff, andpack) accept a full session path, a session id with--store, the special selectorlatest --store .rewind, or a store directory when it contains exactly one session. doctorvalidates that the session can be read and prints a plain-language summary with provider, event counts, model/tool steps, redaction status, token usage, and suggested next commands. Use--jsonfor automation.inspectprints a labeled timeline table withstep,kind,lane,site, a short fingerprint, request detail, token usage, and flags such asstream,error, orprovenance=live.timelineis an alias. Use--kind,--site,--errors,--live,--from, and--toto focus large sessions. Use--full-fingerprintwhen comparing exact request/tool hashes,--jsonfor automation, or--no-headerfor compact TSV output.contextanddiffoperate on model-call steps. By default,contextprints a readable view of the first model call anddiffcompares the first two model calls.promptis an alias forcontext; add--jsonfor the raw recorded message array. Pass--site,--from-site, or--to-sitewhen you know the stablesitename from your harness. Pass--step,--from, or--towhen you need a specific numeric step frominspect.forkstarts at a recorded model-call step, reuses the recorded prefix, and sends the tail to a live provider client. Pick the fork point with--siteor--step, change the live tail with--systemand/or--model, and add--dry-runto verify the plan without spending provider tokens. Dry runs do not check credentials unless you add--check-provider. Built-in providers areopenai,openai-compatible,openrouter, andanthropic. API keys are read fromOPENAI_API_KEY,COMPATIBLE_API_KEY,OPENROUTER_API_KEY, orANTHROPIC_API_KEY; generic compatible endpoints also needCOMPATIBLE_BASE_URLor--base-url. Successful forks write a complete child session: recorded prefix boundaries keepprovenance=recorded, live tail model calls getprovenance=live, and the child can be inspected or replayed as one complete trajectory.toolprints a readable recorded tool call by default. Add--jsonforargs,result,error, stream chunks, latency, and provenance as JSON. Use--namewhen the tool appears once, or--stepafterinspectwhen a tool appears more than once.entropyprints a recordedctx.clock(),ctx.random(),ctx.uuid(), orctx.env()draw as JSON. Use--sourcewhen that source appears once, or--stepafterinspectwhen the same source appears more than once.packexcludes the local vault and prints a redaction summary before writing the.rewindbundle.- Session read failures are formatted as AgentRewind errors. If a command cannot
identify the session, run
agentrewind list .rewind, pass a full session directory such as.rewind/<session-id>, or pass<session-id> --store .rewind. - Recording and harness-aware replay/fork experiments are programmatic because they need your harness code.
