A lightweight Lichess bot framework written in Python. This repository contains a chess engine wrapper, Lichess integration, matchmaking and time-management helpers with a pluggable engine architecture.
- Purpose: run an automated bot that can play games on Lichess (or be used as a local engine harness).
- Main entrypoint:
main.py(project root) - Important directories:
engines/— engine implementations and helpers (e.g.dragonbot.py,opening.py)lib/— core library code (Lichess client, matchmaking, models, config helpers)
- Python 3.8+
- A working internet connection for Lichess integration (unless running in local/offline mode)
- Dependencies listed in
requirements.txt
- Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies:
pip install -r requirements.txt- Copy the example config:
config.yml.default->config.ymland edit values as needed.
copy-item config.yml.default config.yml
notepad config.yml- Typical settings to check/enter in
config.yml:- Lichess API token (if you want the bot to connect to Lichess)
- Bot account name and game settings
- Engine selection and engine-specific options
- Start the bot from the project root:
python main.py- Behavior depends on configuration in
config.yml. If the bot connects to Lichess it will listen for incoming challenges / pairings depending on the matchmaking settings.
main.py— application entrypoint and runtime orchestration.config.yml.default— example configuration used as a template.engines/dragonbot.py— primary engine implementation for the project.lib/lichess_bot.pyandlib/lichess.py— Lichess API integration and types.lib/matchmaking.py,lib/time_manager.py,engines/time_manager.py— utilities for pairing and time control.
- Add or extend engine implementations under
engines/. - Core logic lives in
lib/. Keep Lichess-specific code isolated from engine code where possible to make testing easier.
- If the bot doesn't start, verify Python and virtual environment activation.
- Check
config.ymlexists and contains valid values. If you only haveconfig.yml.default, copy it toconfig.ymlbefore running. - If Lichess connection fails, verify the API token and network connectivity.