A chess engine built entirely in the ShellLite programming language, along with a Lichess Bot Bridge integration.
- Universal Chess Interface compliant engine loop
- Optimised search using Negamax with Alpha Beta Pruning and Transposition Table caching
- Tactical evaluation featuring Piece Square Tables and Delta Pruning
- Custom legal capture generator for quiescence search
- Lichess integration with automatic reconnection on stream disconnections
The system consists of two primary components.
- The ShellLite Chess Engine: Written in ShellLite, implementing the board representation, move generation, and tactical search. It communicates using the standard Universal Chess Interface protocol.
- The Lichess Bot Bridge: A multithreaded Python application that streams challenges and game events from Lichess, automatically spawning separate, isolated ShellLite engine processes to calculate and make moves for each game.
- Python 3.10 or higher
- Requests library
- ShellLite interpreter
- Clone this repository to your local machine.
- Install the required Python dependencies: pip install shell-lite pip install requests
- Copy the configuration template file: copy lichess_config.json.example lichess_config.json
- Edit lichess_config.json and replace YOUR_LICHESS_BOT_TOKEN_HERE with your private Lichess Bot API token.
To run and test the engine locally via the Universal Chess Interface CLI:
- On Windows, run the run_engine.bat file.
- On Linux or macOS, run: shl main.shl OR shl run main.shl
To start the bot and connect it to Lichess:
- On Windows, run the run_lichess.bat file.
- On Linux or macOS, run: python lichess_bot.py
ENJOY!
License: MIT