Quickstart
twin needs Node 22 or newer.
npm install -g @crypticsaiyan/twincliThis installs the twin command. To try it without installing, prefix a command with npx @crypticsaiyan/twincli.
You have a command that fails on your machine. Nothing is uploaded and no account is needed.
-
In the project where the command fails, run it through twin:
twin capture -- npm testtwin runs the command as usual and shows its output.
-
twin prints a summary of what it recorded and asks:
Write twin-capsule.json? [y]es / [n]o / [v]iew full JSON:Press
vto read the full JSON first,yto write it,nto stop. -
Attach
twin-capsule.jsonto the issue. On GitHub, drag the file into the comment box.
You have a capsule from an issue and want to see the failure.
-
Get a Solari API key from console.getsolari.com and export it, or put it in a
.envfile. twin readsSOLARI_API_KEYfrom the nearest.envabove the working directory that sets it.export SOLARI_API_KEY=slr_live_... -
Replay the capsule. Pass the attachment link from the issue, or a downloaded file:
twin replay https://github.com/user-attachments/files/<id>/twin-capsule.jsontwin replay twin-capsule.jsontwin starts a clean Linux sandbox, installs the captured Node version, checks out the exact commit, applies the reporter’s uncommitted diff, installs the dependencies, sets the captured environment and runs the command three times.
-
Read the verdict.
REPRODUCEDmeans every attempt failed the way it did on the reporter’s machine. The other verdicts are explained in Replay. -
Go further:
twin replay twin-capsule.json --keep # leave the machine running at the failuretwin shell # open a terminal on it (Ctrl-] detaches)twin bisect twin-capsule.json --good mine.json # find the difference that breaks ittwin verify twin-capsule.json --patch fix.patchtwin stop # stop anything still running
For bisect, capture a passing run yourself at the same commit with twin capture -- npm test.
Try it on a real issue
Section titled “Try it on a real issue”The repository contains the capsules for apache/echarts#21538. With a key set, from a clone:
twin replay examples/echarts-21538/new-york.jsontwin bisect examples/echarts-21538/new-york.json --good examples/echarts-21538/kolkata.jsontwin verify examples/echarts-21538/new-york.json --patch examples/echarts-21538/fix.patchEach takes about 70 seconds.
Working from source
Section titled “Working from source”git clone https://github.com/crypticsaiyan/twincd twinpnpm installpnpm dev replay examples/echarts-21538/new-york.json # runs from source, Node 22.18 or newerpnpm build && node dist/bin.js --help # or build first- Capture: what is recorded and how to share values.
- Issue template: ask for capsules when the issue is filed.
- AI agents: let a coding agent work in the reporter’s environment.