pi-tic-tac-toe
v0.1.0
Published
Tic tac toe extension for Pi
Maintainers
Readme
pi-tic-tac-toe
Play a quick game of tic tac toe against the LLM inside Pi.
pi-tic-tac-toe adds a persistent TUI overlay opened with /tic-tac-toe. You play X, the LLM plays O, and the game stays in your Pi session so you can close the overlay and resume later.
Features
- Centered terminal overlay, built with Pi TUI
- Human vs LLM gameplay
- Arrow-key and number-key input
- Session persistence across Pi reloads/resumes
- Validated saved state and legal move checking
- TypeScript source, no build step required
- Manual npm publish workflow included
Install
pi install npm:pi-tic-tac-toeOr add it to ~/.pi/agent/settings.json:
{
"packages": ["npm:pi-tic-tac-toe"]
}Usage
Start or resume a game:
/tic-tac-toeStart a fresh game:
/tic-tac-toe newControls
| Key | Action |
| --- | --- |
| Arrow keys | Move cursor |
| 1-9 | Jump to a square |
| Enter | Place X |
| n | New game |
| q | Close overlay |
The overlay is TUI-only. It will not open in Pi print, JSON, or RPC modes.
How It Works
After you place X, the extension asks the LLM to play O by calling:
make_tic_tac_toe_moveThe extension validates every move, so the LLM cannot move out of turn, overwrite a square, or continue after the game is over.
Development
npm install
npm test
npm run checkTry the extension locally:
pi -e ./extensions/index.tsThen run:
/tic-tac-toePackage Notes
Pi loads TypeScript extensions directly, so this package publishes the source .ts files. Pi core packages are declared as peer dependencies to avoid bundling duplicate Pi runtime packages.
License
MIT
