ChessGame is a native macOS chess app built with Swift Package Manager. It runs entirely offline at runtime and plays against a bundled local Stockfish engine.
- macOS 14 or newer.
- Xcode or Xcode Command Line Tools with Swift available on
PATH. - Network access only for the one-time asset fetch step.
Fetch the engine, chess pieces, sounds, and license metadata once:
bash Scripts/fetch-assets.shConfirm the required pieces and Stockfish engine are present, and that the local engine answers the UCI handshake:
bash Scripts/verify-assets.shverify-assets.sh is a no-network diagnostic. It checks the bundled piece assets, reports sound assets, and confirms the Stockfish binary answers uci with uciok from the local bundle only.
Open the Swift Package Manager package directly in Xcode:
open Package.swiftYou can also use:
xed .No .xcodeproj is needed. After Xcode opens, wait for package resolution to finish, choose the ChessGame executable scheme, set the run destination to My Mac, then press Cmd-R.
SwiftPM .module resources resolve automatically when launched from Xcode, including the ChessUI bundle with pieces and sounds. The Stockfish engine and full asset set still come from bash Scripts/fetch-assets.sh, so run that once before launching from Xcode.
If Stockfish is still not found in an Xcode run, copy the fetched binary to:
~/Library/Application Support/ChessGame/stockfishor place stockfish somewhere on PATH. The discovery chain searches bundled resources first, then Application Support, then PATH. When the engine is missing, the app shows a clear in-app offline message and never downloads anything at runtime.
Fetch and verify the engine, chess pieces, sounds, and license metadata once:
bash Scripts/fetch-assets.sh
bash Scripts/verify-assets.shAssemble the app bundle:
bash Scripts/build-app.shFor a no-write preview of the planned bundle layout:
bash Scripts/build-app.sh --dry-runThe finished app is written to ChessGame.app.
Open the app bundle from Finder or run:
open ChessGame.appThe app also includes the command-line executable at:
ChessGame.app/Contents/MacOS/ChessGameUse the side panel to start a new game, resign, flip the board, undo a move, pick the AI difficulty, and choose which side you play. Difficulty changes are applied to the bundled Stockfish engine through UCI strength settings.
The shipped app does not make runtime network calls. Scripts/fetch-assets.sh is the only networked workflow, and it runs before launching or packaging to download local assets. Scripts/verify-assets.sh is offline-only and never downloads anything. Scripts/build-app.sh runs Scripts/offline-check.sh as a packaging gate, and the app bundle includes sandbox entitlements with no network client entitlement.
Engine discovery is local-only: bundled resources first, then ~/Library/Application Support/ChessGame/stockfish, then PATH. If Stockfish is missing, the app reports a clear local engine error in the UI instead of downloading anything.
The bundled Stockfish binary is licensed under GPLv3 and is included as a separate executable resource. The cburnett chess pieces are GPL-licensed assets. The bundle copies LICENSES/ from Sources/ChessUI/Resources/LICENSES so the app package carries the relevant asset notices.