Chess Engines

cli-chess – play chess in your terminal

Chess has the virtue of being suitable for people of all ages. It has many positive attributes helping players develop their memory, improve and enhance their concentration, as well as enhance logical thinking. It also promotes and improves imagination and creativity. Chess is one of those games that takes a few days to learn and the rest of your life to master, with the game being a never ending learning process, even for the top players.

cli-chess is a command-line chess program that lets you play online against human players and offline against the computer.

The software is published under an open source license.

Installation

We tested cli-chess with Manjaro, an Arch-based distro.

The project recommends you install cli-chess with pip. We strongly recommend you don’t use pip. From experience, installing lots of software with pip inevitably leads to a broken system in the long run. While installing cli-chess with pip is unlikely to cause a broken system, it’s still a good habit to use pipx whenever a project recommends installing their software with pip.

pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages.

Install cli-chess with the command:

$ pipx install cli-chess

To play online, you need to create an API token. The process is simple.

In Operation

We tested cli-chess with Tabby, our recommended terminal emulator. By default, Tabby uses the Liberation Mono font. Pieces aren’t displayed well with this font in cli-chess. The developer recommends using Ubuntu Mono, MS Gothic, or NSimSun to improve character placement. None of these fonts were installed on our test system. There’s a package for Ubuntu fonts which is installed with the command:

$ sudo pacman -S ttf-ubuntu-font-family

Here’s the menu you’ll see when starting the program.

Menu

As you can see, you can play online as well as offline. Online activity needs an account with Lichess.org. You can play online against humans, a computer, or watch a ‘TV’ channel. All the Lichess variants are supported. The ‘TV’ channel lets you watch Top Rated, Bullet, Blitz, Rapid, Classical, Crazyhouse, Chess960, King of the Hill, Three-check, Antichess, Atomic, Horde, Racing Kings, UltraBullet, Bot, and Computer games.

You’ll need to increase the font size in the terminal unless you can cope with a microscopic board. With Tabby, that’s Ctrl and +.

In the image below, we’re watching a bullet game with black being played by a Grandmaster. Hopefully the developer will enable the clocks to be updated dynamically in a future release.

Online activity with cli-chess

If you want to play offline, you can pit your wits against Fairy-Stockfish, a chess variant engine derived from Stockfish designed for the support of fairy chess variants and easy extensibility.

Chess board with cli-chess

There are customization options including the ability to theme the board and pieces with different colours.

Summary

cli-chess is a handy client if you like playing chess in a terminal. The client supports all Lichess variants and blindfold.

We’re definitely not fans of entering moves without mouse support. Having to enter moves in short algebraic notation, long algebraic notation or UCI harks back to the early days of chess clients such as the Internet Chess Server.

From a graphical perspective, the experience of playing games with cli-chess doesn’t come anywhere near to a polished GUI client such as Lucas Chess. But playing chess against a computer can be a demoralising experience. It’s much more enjoyable to play against a human player.

Website: github.com/trevorbayless/cli-chess
Support:
Developer: Trevor Bayless
License: GNU General Public License v3.0

cli-chess is written in Python. Learn Python with our recommended free books and free tutorials.

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Simon
Simon
10 months ago

I’m a bit out of touch with internet chess servers. Is FICS still popular?

Craig B
Craig B
10 months ago
Reply to  Simon

Yes, it’s always easy to get a game there.

Nelson
Nelson
10 months ago

I’m always astounded by the length and breadth of open source software. There’s lots of dross of course, but so many undiscovered gems too.