A text-based middleware to Lichess's board API, written in Rust.
Currently, the minac
binary waits for input from stdin
:
- moves are inputted as SAN (Standard Algebraic Notation). E.g.
d4
,Nf4
,Qxf7
... - chess game status is recorded using the
chess
crate - lichess API is used via the
lichess_api
crate for online games and for saving copies of offline games into a study - you can play against another human or against Stockfish via the commandline
To compile it locally, you need my fork of the chess
crate and my fork of the lichess-api
crate.
Most changes are merged upstream for the Lichess API (hopefully all when I clean up this PR and submit upstream). For the chess
crate, I need support for PGN that I added in this PR, however it doesn't seem like this PR will be merged (has been open for literally years with no feedback).
You hence need to clone both my forks and put them somewhere minac
can find them. By default, this is next to the minac
folder you cloned, see Cargo.toml
.
Because I need a custom chess
crate version, you also need to clone the vampirc-uci
crate even though I did not modify it. Clone it from here and modify its Cargo.toml
as follows:
-chess = { version = "3.2", optional = true }
+chess = { path = "../chess", optional = true }
Finally, a Lichess token with the challenge:read/write
, board:play
and study:write
permissions is needed: get it from here and write it in the token.secret
file at the root of the project, before running cargo run
.
This software is still in alpha, and I don't have experience with Rust. You've been warned ;).
A 3D printed chess clock that makes it easy to play on a physical board connected to Lichess, and can serve as a game notation device that create studies, analyzes games etc.
The final object will probably be:
- A Raspberry Pi
- A speaker
- A 3D printed casing
- Small LCD screen
- Buttons connected to the a GPIO pin (voltage dividers)
- two clock buttons
- ranks: from 1 to 8 included, optionally 0 and 9 also for time settings
- files: A to H included
- pieces: king, queen, rook, bishop, knight
- online mode button (lichess logo), offline mode button (stockfish logo)
All the buttons, except the clock buttons, could be replaced by a touchscreen. Everything should be handled by the minac
binary.
Wanted features:
- Audio clips (confirm inputted moves, error when wrong move is pressed...).
- Online mode
- Lichess Board API to play using an online account
- Choose ranked or friendly and time settings
- Play against online bots
- Offline mode against bot
- Play against Stockfish and setting its level, possibly other bots
- Choose side, time settings
- Offline 2 players mode
- Standard chess clock features
- Save game as PGN
- Open studies on Lichess
This is v5 I'd say, we're not exactly there.
This project is licensed with the Affero GPLv3. See LICENSE.md for the full license, or this page for a quick recap.
Feel free to send your enhancements and patches as PRs, or open issues.
Currently working on:
- Stockfish integration: initial version is merged, we know need position evaluation on games when they are over, move by move, to identify errors/blunders and output them. This page has all the info I need.
- Lichess studies API: part of it is implemented in this PR for my fork of the lichess_api crate, code needs cleaning before submitting a PR upstream.
On the hardware side:
- Compiling for Raspberry Pi 3B+, same steps as described above: everything works, tested on Raspberry Pi OS Lite 64bit (i.e. ARMv8/AArch64). To compile, Rust (ofc) and the
openssl-dev
package need to be installed. Stockfish needs to be built from source for the ARMv8 architecture: download the sources for Stockfish 16 from here and runmake build ARCH=armv8
. - Interfacing with buttons. First display voltage recevied by a GPIO pin: I'll need a basic circuit with a bunch of buttons and a voltage divider to differenciate between the buttons pushed.
- For the sake of simplicity and since Stockfish needs some computing power, this project will probably not run on a weaker controller than Raspberry Pis. I'll probably use directly the
rppal
crate, instead of going theembedded-hal
route.
Starting to thinker about:
- 3D case design with Blender: something like this to be 3D printed.
Lichess: @zoug
Mastodon: @[email protected]
Github: yzoug