Skip to content

ngthluu/chess-game-agentloop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChessGame

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.

Prerequisites

  • 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.

Run in Xcode

Fetch the engine, chess pieces, sounds, and license metadata once:

bash Scripts/fetch-assets.sh

Confirm the required pieces and Stockfish engine are present, and that the local engine answers the UCI handshake:

bash Scripts/verify-assets.sh

verify-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.swift

You 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/stockfish

or 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.

Build

Fetch and verify the engine, chess pieces, sounds, and license metadata once:

bash Scripts/fetch-assets.sh
bash Scripts/verify-assets.sh

Assemble the app bundle:

bash Scripts/build-app.sh

For a no-write preview of the planned bundle layout:

bash Scripts/build-app.sh --dry-run

The finished app is written to ChessGame.app.

Run

Open the app bundle from Finder or run:

open ChessGame.app

The app also includes the command-line executable at:

ChessGame.app/Contents/MacOS/ChessGame

Playing

Use 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.

Offline Guarantee

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.

Licensing

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.

About

A Mac chess game, built with agentloop

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors