MacOS – play chess on the Mac from the command line

command linegamesmacos

If I were feeling insufficiently geekish on any particular day, and thus found the GUI Chess App to lack an appropriate amount of tech credibility, is there a way to play chess on my Mac from the command line?

Best Answer

Yes! The OS X Chess app relies on the sjeng engine, which has a command line version. Type /Applications/Chess.app/Contents/Resources/sjeng.ChessEngine and press enter to play:

enter image description here

Make moves with the coordinates of the origin and destination you want: e1e4 moves the piece at e1 to e4.

Sjeng doesn't take any command line arguments, but you can edit the config file (stored in /Applications/Chess.app/Contents/Resources/sjeng.rc). This will probably mess with your settings in the GUI Chess app; make a backup before editing.