Learn how to install, configure, and play chess in your terminal.
A minimal, elegant command-line tool that lets you solve Lichess puzzles and play full games against a local AI directly in your terminal.
Built for developers and terminal power users who want a quick chess puzzle fix without leaving their command line. No account required, no configuration needed.
Install chesshell using our quick installer script:
curl -fsSL https://chesshell.pages.dev/install.sh | bash
Open PowerShell as an Administrator and run the following command to automatically download and install chesshell and add it to your PATH:
iwr -useb https://chesshell.pages.dev/install.ps1 | iex
Fetch today's featured puzzle from Lichess and start an interactive session:
chesshell play
Play a full chess game directly in your terminal against Stockfish. You can select your difficulty and your preferred color (White or Black).
chesshell play --ai
If you close your terminal during an AI game, you can pick up exactly where you left off:
chesshell resume
chesshell automatically detects if your terminal supports graphical pieces. You can manually override this or save your preference:
chesshell play --unicodechesshell config unicode on (or off)Check your aggregate stats or a table of your most recent attempts:
chesshell stats
chesshell history
chesshell interacts with the public, unauthenticated endpoints of the Lichess API to fetch puzzle data.
For AI games, it runs Stockfish locally via the UCI protocol. If Stockfish is not found on your system PATH, chesshell caches a downloaded copy under your OS config directory.
When playing, enter moves using UCI (Universal Chess Interface) notation.
e2e4 (moves a piece from e2 to e4)f3d5 (moves piece to capture on d5)e7e8q (promotes to queen)Type hint (or h) in puzzles to see the starting square of the correct move. Type quit (or q) to abandon a session.
To completely remove chesshell, its local data, and cached engine:
chesshell uninstall
This project is licensed under the MIT License - see the LICENSE file for details.
A minimal, high-performance chess tool for the terminal. chesshell is designed to provide a distraction-free environment for chess puzzles and AI games, prioritizing speed, local-first data persistence, and zero-configuration setup.
The project is structured into several modular packages within the internal/ directory, following standard Go project layouts.
internal/boardThe core state machine. It wraps the github.com/corentings/chess library to manage game logic.
UTF-8 support) via environment variable analysis (LANG, TERM, etc.).internal/engineManages communication with the Stockfish chess engine.
PATH.internal/apiA thin client for the Lichess.org API.
internal/storeThe persistence layer.
data.json file in the user's config directory (e.g., ~/.config/chesshell/).├── cmd/ # Cobra command definitions (entry points)
├── internal/
│ ├── api/ # Lichess API integration
│ ├── board/ # Board logic and ASCII/Unicode rendering
│ ├── engine/ # Stockfish process management & binary downloader
│ ├── puzzle/ # Session managers for Puzzles and AI Games
│ └── store/ # JSON persistence and data models
├── main.go # Application entry point
└── data.json # (Created at runtime) Local state & config
PATH.git clone https://github.com/Killiivalavan/chesshell-cli.git
cd chesshell-cli
go build -o chesshell main.go
When contributing, please adhere to these architectural constraints:
data.json schemas, ensure old versions are migrated without data loss.go fmt ./... before committing.cmd/ package thin; move business logic into internal/.data.json)The application persists data using the following schema:
config: User preferences (e.g., unicode mode).stats: Aggregate win/loss and solve counts.aiGames: Specific records for games against Stockfish.currentGame: Mid-game state (FEN and difficulty) to support the Resume feature.history: A rolling buffer of the last 200 puzzle attempts.This project is licensed under the MIT License. See LICENSE for details.