A minimal Emacs client for the Lichess API.
Challenge Stockfish and play directly from Emacs:
Here is a quick demonstration of browsing Lichess TV and watching a live game:
Follow live tournaments with a multi-board grid view:
Display Support
Lichess.el is designed to work seamlessly in both GUI and terminal (emacs -nw) versions of Emacs. Rendering uses a simple text-based board for the best compatibility.
- TV
- [X] Live Lichess TV channels list (
M-x lichess-tv) - [X] Select a game with
RETto watch it live inside Emacs. - [X] Inspect any TV channel (
M-x lichess-tv-debug)
- [X] Live Lichess TV channels list (
- Tournament Broadcasts
- [X] Browse live broadcasts (
M-x lichess-broadcast-list) - [X] Watch round with auto-updates in grid view.
- [X] Browse live broadcasts (
- Live Game Watcher
- [X] Stream any Lichess game by its ID (M-x lichess-game-watch).
- [X] Real-time board updates via the NDJSON stream.
- [X] Full game history navigation with
p(previous) andn(next). - [X] Switch board perspective with
v(auto, white, black).
- Playing
- [X] Challenge Lichess AI (
M-x lichess-ai-challenge) - [X] Challenge Friends (
M-x lichess-challenge-user) - [X] Manage Challenges (
M-x lichess-challenge-list) - List, Cancel, Accept. - [X] Make moves with
m(UCI format) - [X] Resign with
R - [X] Propose/Accept draw with
D - [X] Mouse Support (v0.3): Click square to select/move pieces (GUI only).
- [X] Challenge Lichess AI (
- Core
- [X] Interactive umbrella dispatcher (
M-x lichess) - [X] Diagnostics: token + active games (
M-x lichess-diagnose)
- [X] Interactive umbrella dispatcher (
- FEN / Board
- [X] Parse FEN -> internal position struct
- [X] Render board (ASCII, Unicode, or SVG)
- [X] Multiple board themes (Brown, Blue, Green)
- [X] Header displays side-to-move, castling rights, en passant target, and perspective.
- Roadmap
- [X] Watch a single game (
lichess-game.el) - [X] Live board stream (NDJSON)
- [X] Submit moves and play
- [X] Challenge API (against AI)
- [X] MELPA packaging
- [X] GUI Rendering (SVG) (v0.2)
- [X] Material Diff (v0.6)
- [X] Tournament Broadcasts (v0.7)
- [ ] Puzzles & tactics
- [X] Watch a single game (
Clone and add to your load path:
(add-to-list 'load-path "~/path/to/your/lichess")
(require 'lichess)Some commands require a personal API token (e.g., playing games, viewing protected user data).
- Go to https://lichess.org/account/oauth/token
- Create a token with appropriate scopes.
- Configure it in Emacs:
(setq lichess-token "YOUR_TOKEN_HERE")You can configure Lichess.el using M-x customize-group RET lichess RET or by setting variables directly in your config.
lichess-token: Your personal API token. Required for playing games and viewing protected data.
lichess-board-gui-preferred-style: Style for GUI frames (“svg”, “unicode”, “ascii”). Default: “svg”.lichess-board-tui-preferred-style: Style for Terminal frames (“unicode”, “ascii”). Default: “unicode”.lichess-board-gui-light-square-color: Color for light squares. Default: “#f0d9b5”.lichess-board-gui-dark-square-color: Color for dark squares. Default: “#b58863”.lichess-core-chess-font: Font family for Unicode chess pieces. Key for alignment in non-graphical modes or fallback.lichess-board-gui-asset-path: Directory containing SVG piece assets.M-x lichess-board-gui-toggle-theme: Switch board color theme (Brown, Blue, Green)
lichess-ai-default-level: Default Stockfish difficulty level (1-8). Default: 1.lichess-ai-default-clock-limit: Initial clock limit in seconds. Default: 300 (5 mins).lichess-ai-default-clock-increment: Clock increment in seconds. Default: 3.
lichess-tv-fetch-delay: Delay (seconds) between TV game fetches to prevent rate-limiting. Default: 0.12.lichess-util-eval-delay: Minimum delay (seconds) between cloud evaluation requests. Default: 1.0.lichess-board-gui-evaluation-gauge-width: Width of the evaluation gauge in pixels. Default: 12.
lichess-announce-events: When non-nil, announce game events (moves, resignation, results) in the echo area for screen readers. Default: nil.lichess-announce-use-buffer: When non-nil, log all announcements to a persistent*Lichess Announcer*buffer. Default: nil.
Here is a complete configuration using use-package:
(use-package lichess
:commands (lichess lichess-tv lichess-game-watch)
:custom
(lichess-token "YOUR_TOKEN")
(lichess-core-chess-font "DejaVu Sans Mono")
(lichess-board-gui-light-square-color "#f0d9b5")
(lichess-board-gui-dark-square-color "#b58863")
(lichess-ai-default-level 3))M-x lichess-> main entrypoint, shows dispatcher to all subcommandsM-x lichess-tv-> show TV channels listgrefreshes listRETopens game on the current line
M-x lichess-broadcast-list-> browse live tournament broadcastsM-x lichess-ai-challenge-> start a new game against StockfishM-x lichess-game-watch-> watch a specific game ID
When in a game buffer (started via M-x lichess-ai-challenge):
m-> Prompt for a move (UCI format, e.g.,e2e4)R-> Resign the game (requires confirmation)D-> Propose or accept a draw (requires confirmation)K/Q-> Castle Kingside / Queenside (O-O / O-O-O)p/n-> Navigate move historyv-> Cycle board perspectiveq-> Quit stream and close game
See CONTRIBUTING.md for instructions on setting up the environment, running tests, and submitting pull requests.
Chess pieces by Colin M.L. Burnett, licensed under CC BY-SA 3.0.
GPL-3.0-or-later See LICENSE for details.