Chancellor is a chess opening repertoire builder that assists in creating an opening repertoire for chess players to practice and improve their game. The application provides an interface for searching and evaluating chess moves in specific openings and allows the generation of PGN files that can be uploaded to training platforms like chessable.com.
The application aims to build an optimized opening repertoire for you based on the Lichess database, allowing you to focus on lines where your opponents are more likely to make mistakes. This is done through a weighted average probability to win from a given position, giving you a repertoire not just based on theoretically sound moves but on practical pitfalls as well.
- Browse and evaluate different chess openings.
- Generate PGN files for training.
- Optimizes your repertoire based on practical play, not just theoretical soundness.
To run the application locally, use one of the following commands:
npm run start:development:localor
npm run start:production:localThe best way to create a robust and accurate repertoire is to set up both the Lichess database and a local chess engine like Stockfish.
You can download and set up the Lichess openings database locally from here.
It is recommended to reduce the number of plies to ~30 to reduce the size of the database. This can be done by changing
const MAX_PLIES: usize = 30;This way you can save your disk space and reduce the time it takes to upload files from database.lichess.org into the database.
To run Stockfish locally:
cd stockfish
npm install
npm start # Optionally pass time to think in milliseconds- Use the UI to browse through openings and evaluate moves.
- Generate a PGN file based on your selected repertoire.
- Import the generated PGN file to Chessable.
Note: While importing to Chessable, set the Format of variations/games title to the Event field of the PGN and disable
the Import all sub-variations as their own item option.
- The application uses the Lichess database, which has request limitations. As such, excessive querying may result in temporary bans. The app is demo-ready but not production-ready in this state.
- For evaluation purposes, the app uses pre-calculated evaluations from Lichess Cloud Eval API. These are good for demos but not recommended for production use.
Check out the live demo here.
Please note that the live demo is limited to very low depths of opening lines due to rate limiting enforced by the Lichess API. As such, while the demo provides a snapshot of the application's capabilities, it's not suitable for building a comprehensive and optimized chess repertoire.
For users interested in leveraging the full capabilities of Chancellor to build a robust repertoire, it's recommended to set up a local environment. Details on how to do this are available in the Chess engine setup section of this README.
The application relies on several key libraries for functionality and UI:
- React: UI Library
- TypeScript: Static typing for JavaScript
- @headlessui/react: A UI framework for React
- @heroicons/react: A set of SVG icons for React
- chess.js: Chess rules engine
- chessground: Awesome interactive chess board from lichess.org
- @bity/oauth2-auth-code-pkce: OAuth2 with PKCE support
- file-saver: File saving utility
MIT
Contributions, issues, and feature requests are welcome. Feel free to check the issues page.
Happy Chess Playing!

