chess-cli tracks a standard chess game while a human moves pieces on a physical board and an LLM or Stockfish supplies the opponent's moves.
For the default LLM mode:
- Ollama, OpenAI, or another server exposing
POST /v1/chat/completions - A model name
For Stockfish mode:
- Install Stockfish separately and ensure the
stockfishexecutable is available onPATH
The application does not download or bundle Stockfish.
For OpenAI, set the API key in the environment before starting the program:
$env:OPENAI_API_KEY = "your-key"API keys are never stored in the application config file.
LLM mode is the default. Ollama is the default provider and the opponent plays black by default:
chess-cli --model gemma4:31bUse OpenAI and have the model open as white:
chess-cli --provider openai --model your-model --opponent-color whiteChoose the model's reasoning level for this run (the default is medium):
chess-cli --reasoning-effort highPrint the model's raw reasoning and response before each move:
chess-cli --model gemma4:31b --debugUse any OpenAI-compatible endpoint:
chess-cli --provider compatible --url http://localhost:8080/v1 --model local-modelLoad a game and automatically save it when the game ends:
chess-cli --provider ollama --model gemma4:31b --load game.pgn --save finished.pgnUse Stockfish at full skill with one second of search time per move:
chess-cli --mode stockfishChoose either a Stockfish skill level from 0 through 20 or an Elo limit from 1320 through 3190:
chess-cli --mode stockfish --stockfish-skill 10 --stockfish-movetime 500
chess-cli --mode stockfish --stockfish-elo 1800 --opponent-color white--stockfish-skill and --stockfish-elo select mutually exclusive strength modes and cannot be supplied together. Stockfish settings are invalid in LLM mode, and LLM provider options are invalid in Stockfish mode. The older --llm-color option remains available as an alias for --opponent-color but cannot be used at the same time.
Run chess-cli --help for all startup options.
Enter a legal move in Standard Algebraic Notation, such as e4, Nf3, O-O, or Qh4#. The configured opponent color moves automatically after a human move. LLM responses are checked against the legal moves; an invalid response is retried up to three times without changing the board. Stockfish moves are received through its UCI protocol and checked by the same chess rules before being applied.
Interactive commands:
/moveasks the configured opponent to make exactly one move for the current side, then returns to the prompt. This supports switching sides or manually advancing computer-vs-computer play./boarddisplays the current ASCII board./save [path]saves the current game..pgnwrites PGN;.txtand extensionless paths write numbered SAN movetext./newstarts over after confirming any unsaved moves can be discarded./helpshows command help./quitexits, confirming first if moves have not been saved.
LLM-mode commands:
/provider ollama|openai|compatibleswitches provider./model <id>changes the current provider's model./url <uri>changes the current provider's API base URL./reasoning <low|medium|high>changes the current provider's reasoning level.
Stockfish-mode commands:
/skill <0-20>selects Stockfish skill mode and changes the skill level./elo <1320-3190>selects Stockfish Elo-limited mode./movetime <milliseconds>changes the positive search time per move.
Mode-specific commands are rejected in the other mode. Provider profiles and Stockfish settings changed by interactive commands are persisted under the user's application-data directory at chess-cli/config.json. Startup arguments override those preferences for one run only; --mode itself is never persisted and defaults to llm on every launch.