Play chess against the Stockfish engine in your terminal.
Now rewritten in TypeScript with enhanced aarch64 compatibility!
This package is now available as a TypeScript/Node.js application via NPM with enhanced aarch64 support:
# Install globally
npm install -g chs
# Or run without installing
npx chsRequirements:
- Node.js 16+ (has excellent aarch64/ARM64 support)
- Stockfish chess engine (automatically detected or install separately)
Install Stockfish:
- Ubuntu/Debian:
sudo apt install stockfish - Fedora:
sudo dnf install stockfish - Arch Linux:
sudo pacman -S stockfish - macOS:
brew install stockfish
CHS has comprehensive Termux support with extensive testing and mobile optimizations:
# Install Node.js and npm
pkg install nodejs
# Install Stockfish engine
pkg install stockfish
# Install chs
npm install -g chsTermux Features:
- ✅ Full ARM/AArch64 support - Works on all Android architectures
- ✅ Mobile optimizations - Reduced memory usage and single-threading for battery life
- ✅ Multi-variant support - Works with Termux, Termux Beta, and Termux Nightly
- ✅ TypeScript reliability - Enhanced type safety and modern JavaScript features
- ✅ Smart error handling - Detailed troubleshooting guidance for mobile devices
For detailed Termux instructions and troubleshooting, see TERMUX.md.
The original Python version is still available via PyPi:
$ python3 -m pip install chs
Note: On some systems, you may also need to install the Stockfish chess engine separately:
- Ubuntu/Debian:
sudo apt install stockfish - Fedora:
sudo dnf install stockfish - Arch Linux:
sudo pacman -S stockfish - macOS:
brew install stockfish
There is a chs-git package in the Arch User Repository, which you can install with an AUR helper:
$ yay -S chs-git || paru -S chs-git
To play against the default level 1 (easiest) version of the Stockfish engine, just run chs command.
$ chs
To see all possible options, use the help command.
$ chs --help
To play as the black pieces, use the --play-black flag.
$ chs --play-black
You can also specify the level of the engine if you want to tweak the difficulty.
$ chs --level 8
On Termux, the app will automatically detect the environment and use the system-installed Stockfish. If you encounter any issues, you can manually specify the Stockfish path:
export CHS_STOCKFISH_PATH=/data/data/com.termux/files/usr/bin/stockfish
chsThere are a few things you can do while playing:
- Make moves using valid algebraic notation (e.g.
Nf3,e4, etc.). - Take back your last move by playing
backinstead of a valid move. - Get a hint from the engine by playing
hintinstead of a valid move.
This software is free to use under the MIT License. See this reference for license text and copyright information.