Skip to content

Introducing an advanced chess bot that automates gameplay on 2D on-screen chess boards, delivering a seamless and immersive experience.

License

Notifications You must be signed in to change notification settings

OTAKUWeBer/ChessPilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

198 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChessPilot Logo


ChessPilot — v2.x

A fully offline chess position evaluator and autoplayer for Windows and Linux — powered by ONNX and Stockfish.


A lightweight, privacy-first tool that reads a **2D on-screen chess board** (Chess.com, Lichess, WorldChess, etc.), evaluates the position locally with Stockfish, and (optionally) plays the best move automatically.


🎥 Demo Video


🎉 Highlights (What's New)

v2.1.0 — Stability, Precision & Performance

  • Full pawn promotion support — handled automatically and reliably.
  • Small under-the-hood improvements for cross-platform stability.

v2.0.0 — PyQt6 UI (Polished)

  • Brand-new PyQt6-based frontend (replaces old Tkinter UI).
  • Same workflow and shortcuts — just smoother and more stable.

⚡ Features

  • 100% Offline — all detection & analysis run locally.
  • Automatic Stockfish Download (CPU-Optimized) — ChessPilot automatically detects your CPU features (AVX2, AVX512, POPCNT, etc.) and downloads the most optimized Stockfish build on first run.
  • FEN Extraction — ONNX-based piece detector (Zai-Kun’s model).
  • Stockfish Analysis — instant best-move suggestions.
  • Auto Move Execution — applies engine moves to the GUI board.
  • Manual Play — use Play Next Move to control timing.
  • Automatic Promotion — follows Stockfish’s preferred choice.
  • Castling Rights & Depth Control — flexible configuration.
  • Retry Logic — failed moves automatically retried up to 3 times.
  • Cross-Platform — AppImage/DEB for Linux, EXE for Windows.

📦 Download

👉 Download the latest release

The ONNX model (chess_detectionv0.0.4.onnx) is included inside all official AppImage, EXE, and DEB builds.


🔒 Windows Antivirus Warnings (False Positives)

Windows may flag unsigned executables — this is common for small open-source projects.

If you see a warning:

  1. Verify the release on GitHub.
  2. Scan the binary on VirusTotal.
  3. Build from source (python src/main.py) for maximum safety.
  4. Only run if comfortable — or use a VM.

🛠️ Engine Configuration (engine_config.txt)

Place this file next to the executable to customize Stockfish:

# ChessPilot Engine Configuration

# Memory in MB (64–1024 recommended)
setoption name Hash value 512

# Number of CPU threads
setoption name Threads value 2

Restart ChessPilot after editing.


⚙️ Prerequisites (From Source)

PyQt6 is required for the UI.

Related Links


Linux

Install system dependencies:

# Ubuntu / Debian
sudo apt install python3-pyqt6        

# Arch Linux
sudo pacman -S python-pyqt6

# Fedora
sudo dnf install python3-qt6

Wayland Users (Arch Linux only)

If you are running Wayland instead of X11, install the following:

sudo pacman -S wayland-utils

Install Python dependencies:

pip install -r requirements.txt

Make sure your Python virtual environment is activated if you are using one.

Windows

pip install -r requirements.txt

If you see errors about missing vcruntime or msvcp DLLs, install the latest VC++ Redistributable - here.


▶️ Run (From Source)

git clone https://github.com/OTAKUWeBer/ChessPilot.git
cd ChessPilot
pip install -r requirements.txt
python src/main.py

Workflow

  1. Choose White or Black.
  2. Set castling rights if needed.
  3. Adjust analysis depth.
  4. Pick Manual or Auto mode.
  5. (Press ESC to reopen color selection.)

✅ Platform Support

  • Windows — tested, EXE provided
  • Linux — tested, AppImage & DEB provided (Wayland supported)
  • macOS — not yet supported (looking for contributors)

🔁 Troubleshooting & FAQ

Board detection is incorrect → Move the ChessPilot UI aside so the detector has a clear view of the board.

Stockfish didn’t download → Check your internet connection and firewall settings. → Alternatively, manually place a Stockfish ZIP or binary in the src/ folder.


🤝 Contributing

PRs and issues are welcome.

Areas that need help:

  • macOS packaging
  • UI/UX enhancements

📜 License

This project is under the MIT License.


🙏 Acknowledgments

Project & Dependencies

  • Zai-Kun — ONNX 2D chess piece detector
  • Stockfish Team — world-class chess engine
  • Microsoft VC++ Runtime
  • All contributors and testers