Open a shell on the failure
After twin replay --keep reproduces a failure, the machine stays up in the reporter’s environment. twin shell opens a terminal on it with the same environment values, PATH, time zone and working directory as the failing command.
Local terminal
Section titled “Local terminal”-
Replay and keep:
twin replay twin-capsule.json --keepThe machine is kept only when the verdict is
REPRODUCED. -
Open a shell:
twin shellWith one twin machine running you need no id. With several, pass the start of an id, for example
twin shell AlDq8esM. -
You land in the command’s working directory with a banner like:
twin: you are in the reporter's environment; commit 984bf46b2f90; rerun the failing command with: npx jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/util/time.test.tsRerun it, add logging, try a fix, or inspect
node_modules. It is a root shell (bash -i, orsh -iif bash is missing). -
Press Ctrl-] to detach. The machine keeps running, and
twin shellre-attaches from this computer or any other with the same Solari key.exitends the shell session but not the machine.
Without --web, twin shell needs an interactive terminal. Otherwise it exits with twin shell needs an interactive terminal; use --web for a browser terminal.
Browser terminal to share: --web
Section titled “Browser terminal to share: --web”twin shell --webtwin starts ttyd 1.7.7 in the guest on port 7681, behind HTTP basic auth with the user twin and a fresh random password, and exposes it through a Solari preview URL. The URL goes to stdout and the credentials go to stderr:
Browser terminal on <id> user twin password <random>The link and password together give a root shell on this machine. Share themonly with the reporter. The machine stops after 15 minutes idle or with: twin stopSend the link and password to the reporter and you can both work on the same failing machine. Running --web again restarts the browser terminal with a new password.
On the echarts capsule this opens a terminal in /tmp/twin/repo with TZ=America/New_York and Node 22.23.3, where the test fails with the numbers from the issue.
What the shell is
Section titled “What the shell is”A kept machine carries two files, so twin shell works without the capsule:
| File | Content |
|---|---|
/tmp/twin/env.sh |
export lines for the replay environment: recorded values, TZ, --env values, the PATH with the installed runtimes |
/tmp/twin/shell.sh |
Loads env.sh, changes to the command’s working directory (falling back to /tmp/twin/repo), prints the banner, starts an interactive shell |
twin shell refuses machines that do not have shell.sh: machine <id> was not kept by `twin replay --keep` (no /tmp/twin/shell.sh).
Releasing it
Section titled “Releasing it”A kept machine is billed until it has been idle for 15 minutes or you stop it. List what is running, then stop one machine or all of them:
twin list # MACHINE RUN STATEtwin stop 7f3c2a91 # just this one (start of its id)twin stop # everything twin startedEach stop is confirmed with the Solari gateway before it counts. twin stop prints Stopped N machines and their ids, or No twin machines running.
Options
Section titled “Options”| Option | What it does |
|---|---|
[machine] |
Start of the machine id. Optional when only one twin machine is running. |
--web |
Start a browser terminal and print a link plus a password. |