acnab renders chess positions from standard chess notation in the terminal and in the browser.
Play it free right now: wsams.github.io/acnab/web — no install, no account. Type SAN/PGN moves and watch the board update live. Optional CPU player (Stockfish in the browser) can be toggled on for a real game after a coin toss for White.
The browser UI shows the live board beside a Moves panel: type SAN/PGN, hit Render, and the position updates with FEN, material, and move history. Dual clocks, theme/piece-color presets, and browser-local saves sit alongside the board for over-the-board notation tracking. Turn on CPU player to face Stockfish at a chosen strength — input stays chess notation.
Render a game directly:
python3 chess.py --moves '1. e4 e5 2. Nf3 Nc6 3. Bb5 a6'Use stdin when quoting is inconvenient in bash or fish:
printf '1. d4 d5 2. c4' | python3 chess.py --moves-file -Print shell completion helpers:
python3 chess.py --print-completion bash
python3 chess.py --print-completion fishSave and reload games locally:
python3 chess.py --moves '1. e4 e5 2. Nf3 Nc6' --save demo
python3 chess.py --load demo
python3 chess.py --list-games- Standard SAN/PGN style moves such as
e4,Nf3,Qxd5+,O-O, andc8=Q# - Legacy coordinate-style moves such as
Pf2f4andNb8c6
Open https://wsams.github.io/acnab/web/ to play in the browser for free.
GitHub Pages publishes the static UI from web/ (the site root redirects there). The build is fully static and client-side:
- live board updates while typing
- localStorage drafts and named saves
- theme, SVG piece-set, and piece-color switching plus FEN/status summaries
- flip board for couch co-op
- shareable board links (notation encoded in the URL hash; opening a link resets to the start and autoplays)
- play controls to step through or autoplay a game with sliding piece animation
- optional CPU opponent (Stockfish.js 18 WASM, skill/Elo presets) — off by default; coin toss for who plays White
- no CDN runtime dependency for the chess engine (Stockfish is vendored under
web/vendor/stockfish/, GPLv3)
Example shared game (opens at move 1 and plays through to mate): Open the demo board
python3 -m http.server 8080 --directory webThen open http://localhost:8080/.
Serve web/ with PHP if you want the optional POST render endpoint that shells out to chess.py. Opening web/index.php still serves the same client-side UI.
Install Python dependencies and run the lightweight checks:
python3 -m pip install -r requirements.txt
python3 -m unittest discover -s tests
python3 -m py_compile chess.py web/chess.py acnab_core.py
php -l web/index.phpInstall Node release tooling (used by CI):
npm clean-installBuild the GitHub Pages artifact locally:
npm run build:pagesPushes to master run semantic-release via .github/workflows/release.yml (direct npx semantic-release, no third-party release action). GitHub Pages publishes from the master branch (legacy); .github/workflows/pages.yml verifies npm run build:pages still produces a clean _site/ artifact.
