Skip to content

CLI Commands

CheckAI provides four main commands: serve, play, export, and update.

Global Options

FlagDescription
--lang <LANG>Override locale (e.g. de, fr, zh-CN)
--helpPrint help information
--versionPrint version information

The language is auto-detected from:

  1. --lang CLI flag
  2. CHECKAI_LANG environment variable
  3. System locale
  4. Fallback: English

checkai serve

Start the REST API server with WebSocket support and Swagger UI.

bash
checkai serve [OPTIONS]
OptionDefaultDescription
-p, --port <PORT>8080Port to listen on
--host <HOST>0.0.0.0Host address to bind to
--data-dir <DIR>dataDirectory for game storage
--book-path <PATH>Path to Polyglot opening book (.bin)
--tablebase-path <PATH>Path to Syzygy tablebase directory
--analysis-depth <DEPTH>30Minimum search depth for analysis (≥ 30)
--tt-size-mb <SIZE>64Transposition table size in MB
--analysis-max-jobs <N>256Maximum number of analysis jobs kept in memory.
--analysis-max-concurrent-jobs <N>4Maximum number of analysis jobs to run in parallel; higher values can increase CPU usage.
--analysis-completed-ttl-secs <SECS>3600Time-to-live (in seconds) for completed analysis jobs before they are evicted from memory.

Examples

bash
# Default server
checkai serve

# Custom port with German locale
checkai serve --port 3000 --lang de

# With opening book and tablebase
checkai serve --book-path books/book.bin --tablebase-path tablebase/

# Deep analysis with large transposition table
checkai serve --analysis-depth 40 --tt-size-mb 256

checkai play

Start an interactive two-player terminal game.

bash
checkai play

Terminal Commands

CommandDescription
e2e4Move piece (from-to notation)
e7e8QPawn promotion (append piece letter)
movesList all legal moves
boardShow the current board
resignResign the game
drawClaim a draw (if eligible)
historyShow move history
jsonShow the game state as JSON
helpShow help message
quitQuit the application

checkai export

Export archived games in human-readable format.

bash
checkai export [OPTIONS]
OptionDefaultDescription
--data-dir <DIR>dataDirectory for game storage
-f, --format <FMT>textOutput format: text, pgn, json
-g, --game-id <ID>Export a specific game by UUID
-l, --listList all archived games
-a, --allExport all archived games

Examples exporting games

bash
# List all archived games
checkai export --list

# Export a specific game as PGN
checkai export --game-id 550e8400-... --format pgn

# Export all games as JSON
checkai export --all --format json

checkai update

Check for updates and self-update the binary.

bash
checkai update

This downloads the latest release from GitHub and replaces the current binary in-place. Works on Linux, macOS, and Windows.

Automatic Update Check

CheckAI checks for new versions automatically on startup and notifies you if an update is available.

Released under the MIT License.