Watch and replay runs¶
The viewer turns a run log into a web page you can step through: the board, every move with the agent's reasoning, the chat between agents, costs and the result. It reads only the log (SPEC-012).
Replay a finished run¶
agentplaykit play examples/tic-tac-toe-chat/scenario.yaml
agentplaykit view runs/tic-tac-toe-chat-7.jsonl
This writes runs/tic-tac-toe-chat-7.html and opens it in your browser. The page is one
self-contained file: it works offline and you can share it like any document.
| Control | Keys |
|---|---|
| First / last turn | Home / End |
| Previous / next turn | Left / Right arrow |
| Play or pause | Space, or the Play button (choose the speed next to it) |
| Jump anywhere | the slider |
Options: --out PATH to choose where the page goes, --no-open to only write it.
Many runs¶
agentplaykit play examples/treasure/scenario.yaml --runs 20
agentplaykit view runs/treasure-summary.json
The summary page shows results, winners, errors, steps, cost and pass rates, with a replay link for every run.
Watch live¶
agentplaykit play examples/tic-tac-toe-llm/scenario.yaml --live
Your browser opens before the first move and follows the run as it happens: each move, the model's reasoning, chat and cost appear as they are logged, and "waiting for x…" shows while a model is thinking. Step back to look at earlier turns (following pauses); press Live to catch up. When the run ends, the normal replay page is written as well.
agentplaykit view --live runs/game.jsonlfollows a run started in another terminal.- With
--runs N, live mode follows each run in turn and then shows the summary. --no-openprints the address instead of opening a browser.
Live mode starts a small server on your own machine only (127.0.0.1), behind a random key in
the address, read-only, and gone when the run ends (or on Ctrl+C). It is for watching on the
computer that runs the game; it is not a public website.
Boards and other worlds¶
A world can tell the viewer how to draw it. Tic-tac-toe declares a 3×3 grid, so its board is drawn with each move highlighted:
class TicTacToe(Environment):
view = {"type": "grid", "key": "board", "rows": 3, "cols": 3}
key names the list in the observation that holds the cells. Worlds without a view show what
each agent saw as formatted JSON, and simultaneous worlds (like rock-paper-scissors) show both
choices of a round together.
Safety¶
Logs contain model output, which can be anything. The viewer inserts it as plain text only, and the page's security policy forbids loading anything from the network, so a message or reasoning written by a model can never run as code or contact another site.