A beautiful, cross-platform chess game with Stockfish AI integration, built with Rust and egui.
- π¨ Beautiful GUI - Clean, modern interface built with egui
- π€ Stockfish Integration - Play against the world-class Stockfish engine
- π― Adjustable Difficulty - Choose from multiple skill levels
- π Themes - Classic, Lichess, Chess.com, and Dark themes
- βοΈ Legal Move Highlighting - Visual indicators for valid moves
- π Move History - Track all moves in standard algebraic notation
- π Board Flip - View the board from either side
- πΎ Persistent Settings - Your preferences are saved automatically
Install Rust (1.75.0 or later):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shThis application requires the Stockfish chess engine binary. The binary is NOT included in this repository.
- Visit Stockfish Downloads
- Download the appropriate binary for your platform:
- macOS (Apple Silicon):
stockfish-macos-m1-apple-silicon - macOS (Intel):
stockfish-macos-x86-64 - Linux:
stockfish-ubuntu-x86-64 - Windows:
stockfish-windows-x86-64.exe
- macOS (Apple Silicon):
Place the Stockfish binary in one of these locations (searched in order):
./stockfish(same directory as the executable)~/bin/stockfish/usr/local/bin/stockfish/opt/homebrew/bin/stockfish(macOS Homebrew)- System PATH (as
stockfish)
Or set a custom path by modifying src/app.rs:
let stockfish_path = [
"/path/to/your/stockfish",
// ... other paths
];If you downloaded Stockfish via browser, macOS may have quarantined it. Remove the quarantine attribute:
xattr -d com.apple.quarantine /path/to/stockfishcargo buildcargo build --releaseThe executable will be at:
- Debug:
target/debug/stockfish-chess - Release:
target/release/stockfish-chess
cargo run# Debug build
./target/debug/stockfish-chess
# Release build
./target/release/stockfish-chess- Select a piece - Click on any of your pieces (White starts)
- View legal moves - Valid destinations are shown with dots
- Make a move - Click on a highlighted square to move
- Engine responds - Stockfish will automatically play as Black
- New Game - Start a fresh game
- Flip Board - Rotate the board 180Β°
- Play as - Switch between White and Black (starts new game)
- Difficulty - Adjust Stockfish strength:
- Beginner (800 Elo)
- Casual (1200 Elo)
- Intermediate (1600 Elo)
- Advanced (2000 Elo)
- Expert (2400 Elo)
- Grandmaster (2800 Elo)
- Maximum (3200+ Elo)
- Theme - Change board appearance
src/
βββ main.rs # Application entry point
βββ app.rs # Main app state and UI coordination
βββ engine/ # Stockfish engine integration
β βββ mod.rs
β βββ actor.rs # Engine process communication
β βββ difficulty.rs # Difficulty level definitions
βββ game/ # Chess game logic
β βββ mod.rs
β βββ state.rs # Game state management
βββ ui/ # User interface components
βββ mod.rs
βββ board.rs # Chess board rendering & interaction
βββ controls.rs # Control panel (buttons, dropdowns)
βββ move_list.rs # Move history display
βββ pieces.rs # SVG piece rendering
βββ theme.rs # Color themes
- egui/eframe - Immediate-mode GUI framework
- shakmaty - Chess move generation and validation
- resvg/tiny-skia - SVG rendering for chess pieces
- tokio - Async runtime (for UI responsiveness)
- serde - Settings serialization
src/assets/pieces/- SVG chess piece graphics (embedded at compile time)src/engine/- UCI protocol implementation for Stockfish communicationsrc/game/- Chess rules and state managementsrc/ui/- egui components for the interface
The app communicates with Stockfish via the UCI (Universal Chess Interface) protocol:
- Spawns Stockfish as a child process
- Sends commands via stdin (
uci,position,go, etc.) - Parses responses from stdout (
uciok,bestmove,info, etc.) - Runs in a dedicated thread to avoid blocking the UI
The modular architecture makes it easy to extend:
- New themes: Add variants to
src/ui/theme.rs - New difficulties: Modify
src/engine/difficulty.rs - UI components: Add modules in
src/ui/
- Ensure Stockfish binary is in one of the expected locations
- Check that the binary has execute permissions:
chmod +x stockfish - On macOS, remove quarantine:
xattr -d com.apple.quarantine stockfish
- The Stockfish binary may be incompatible with your system
- Try downloading a different version from the official site
- Check system architecture matches (ARM vs x86_64)
- Ensure SVG assets are present at
src/assets/pieces/ - Check for console errors about missing textures
- Build in release mode:
cargo build --release - Reduce Stockfish thinking time in
src/app.rs(default: 1000ms)
MIT License - See LICENSE for details.
- Stockfish - The powerful open-source chess engine
- shakmaty - Rust chess library
- egui - Immediate-mode GUI library
- Chess piece SVGs derived from lichess-org/lila (CC0)
Contributions are welcome! Please feel free to submit issues or pull requests.
- PGN import/export
- Opening book integration
- Analysis mode with engine evaluation
- Time controls (blitz, rapid, classical)
- Online multiplayer
- Custom board themes
- Move sound effects