Skip to content

Instantly share code, notes, and snippets.

@DOBRO
Created February 7, 2022 08:25
Show Gist options
  • Save DOBRO/bf76f3e9f896e93c149ae34678f1bafc to your computer and use it in GitHub Desktop.
Save DOBRO/bf76f3e9f896e93c149ae34678f1bafc to your computer and use it in GitHub Desktop.
 Stockfish TCP service for macOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.stockfishchess.stockfishd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/stockfish</string>
</array>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>9010</string>
<key>SockType</key>
<string>stream</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
</dict>
</plist>
@DOBRO
Copy link
Author

DOBRO commented Feb 7, 2022

Install Stockfish:
brew install stockfish

Add file org.stockfish.plist to one the folders:

  • /System/Library/LaunchDaemons
  • /Library/LaunchDaemons
  • /System/Library/LaunchAgents
  • /Library/LaunchAgents
  • ~/Library/LaunchAgents

Depending on system environment change path to stockfish executable (/usr/local/bin/stockfish) and port (9010) the service should run on. Reboot computer or run in terminal:
launchctl load /path/to/org.stockfish.plist

Check the service is running:
telnet localhost 9010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment