Chuefi is a TUI chess application built with ratatui and Pleco. It runs both as a UEFI application (booting directly on firmware / in QEMU) and as a regular terminal program on Linux, macOS, and Windows. Both builds share the same menus, engine, and game logic; only the platform layer (filesystem, wall clock, sleeping, and the ratatui backend) differs.
| Path | Purpose |
|---|---|
src/lib.rs |
Shared, platform-agnostic crate (chuefi). |
src/app.rs |
AppState: menu stack, options, rendering, and update loop. |
src/input.rs |
Platform-neutral Key / ScanCode types. |
src/platform.rs |
FileStore trait + global wall-clock hook. |
src/bin/uefi.rs |
UEFI (no_std) entry point and FileStore implementation. |
src/bin/terminal.rs |
Terminal (std, crossterm) entry point and FileStore. |
pleco_vendor/ |
Vendored pleco chess library. |
The crate is no_std by default (for UEFI). The terminal build enables the
std feature, which also pulls in ratatui's crossterm backend.
cargo run --release --no-default-features --features std \
--bin chuefi-terminal --target x86_64-unknown-linux-gnu # Replace with your host target triple Or build only:
cargo build --release --no-default-features --features std \
--bin chuefi-terminal --target x86_64-unknown-linux-gnu # Replace with your host target tripleThe repository pins
x86_64-unknown-uefias the default build target (see.cargo/config.toml), so terminal commands must always pass your host target triple via--target ...(replace the example with your own host). You can print your host triple withrustc -vV.
cargo build --release --bin chuefi-uefi --target x86_64-unknown-uefiTo boot it in QEMU (installs the EFI into esp/ and launches OVMF):
./run-qemu.sh # Linux / macOS
./run-qemu.ps1 # Windows (PowerShell)
# or:
cargo run -p xtask -- qemuChuefi stores an options.cfg, a game.cfg, and a boards/ directory of saved
game trees (*.chtree) under a configurable save path (editable in the
Options menu).
- UEFI default:
boot:\EFI\chuefi\(volume-prefixed;fs<N>:\...selects a specific filesystem handle). - Terminal default: a per-user data directory, resolved from
XDG_DATA_HOME, thenAPPDATA, thenHOME/.local/share, withchuefiappended.
# One-time tooling setup for the pinned nightly toolchain:
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt clippy
# Shared logic, against an in-memory FileStore:
cargo test --no-default-features --features std \
--test smoke --target x86_64-unknown-linux-gnu
# Lint / format:
cargo fmt
cargo clippy --no-default-features --features std \
--bin chuefi-terminal --target x86_64-unknown-linux-gnu.github/workflows/release-build.yml builds release artifacts for the UEFI
image and the Linux, Windows, and macOS terminal binaries, and uploads them as
workflow artifacts (and attaches them to GitHub Releases on tag pushes).
Chuefi is distributed under the terms of the GNU General Public License version 3 or later. See THIRD_PARTY_LICENSES.md for dependency attributions and license details.