Thanks to visit codestin.com
Credit goes to github.com

Skip to content

elbasel-404/chs

 
 

Repository files navigation

♗ chs

Play chess against the Stockfish engine in your terminal.

Now rewritten in TypeScript with enhanced aarch64 compatibility!

Table of Contents

Installation

NPM (Recommended - TypeScript Version)

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 chs

Requirements:

  • 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

Termux (Android)

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 chs

Termux 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.

Pip (Legacy Python Version)

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

Arch Linux

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

Usage

To play against the default level 1 (easiest) version of the Stockfish engine, just run chs command.

How to start playing

$ 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

Termux-specific Usage

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
chs

How to play

There 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 back instead of a valid move.
  • Get a hint from the engine by playing hint instead of a valid move.

License

This software is free to use under the MIT License. See this reference for license text and copyright information.

About

♝♞ Play chess against the Stockfish engine in your terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 71.5%
  • TypeScript 23.8%
  • JavaScript 3.2%
  • Makefile 1.5%