XCI : Extensible Chess Interface

1 State Transition Diagram (Key States)

2 General Types

<string> ::= <word> 
<string> ::= "\"" <word> (<word>)+ "\""; 
<int> ::= ["+" | "-"] ("0" ... "9")+
<pos-int> ::= ("1" ... "9") ("0" ... "9")*
<id> ::= <word>
<square> ::= <file> <rank>
<move> ::= <square> <square> [<promotion-type> | "k"]
<move> ::= <custom-move>
<move-list> ::= <move>+
<score> ::= "score" (("cp" <int>) | ("mate" <int>)) ["lowerbound" | "upperbound"]
<position> ::= <x-fen> 
<position> ::= <custom-position>
<annotation> ::= "!!" | "!" | "!?" | "?!" | "?" | "??" | "normal"
<custom-info> ::= "name" <id> "value" <value>
<result> ::= "1-0" | "0-1" | "1/2-1/2" | "inprogress" | "*"
<value> ::= <int> | <id> | <string> | "true" | "false" | <searchpath>
<searchpath> ::= <string> (";" <string>)*

3 Commands from GUI to Engine

xci

<xci-command> ::= "xci"

level

<level-command> ::= <time-control>
<level-command> ::= "white" <time-control> "black" <time-control>

<time-control> ::= (<tournament-control>)+ [<sudden-death-control>] ["ponder"]
<time-control> ::= <sudden-death-control> ["ponder"]

<tournament-control> ::= <pos-int> "/" <pos-int> ["+" <pos-int>]
<sudden-death-control> ::= <int> ["+" <pos-int>]

setoption

<setoption-command> ::= "setoption" "name" <id> "value" <value>
<setoption-command> ::= "setoption" "name" <id> ("input" <id> "value" <value>)*

position

<position-command> ::= (<position> | "startpos")

result

<result-command> ::= "result" <result> ["{" <string> "}"]

go

<go-move-command> ::= "go" "move" <move>
<go-undo-command> ::= "go" "undo"

<go-think-command> ::= "go" "think" <go-time-info> <go-constraint-info> ["drawoffer"]
<go-ponder-command> ::= "go" "ponder" ["suggestedmove" <move>]
<go-analyze-command> ::= "go" "analyze" <go-constraint-info>
<go-continue-command> ::= "go" "continue" "move" <move> <go-time-info> <go-constraint-info> ["drawoffer"]

<go-time-info> ::= "wtime" <int> "btime" <int> "winc" <int> "binc" <int> "movestogo" <int>
<go-constraint-info> ::= ["searchmoves" <move-list>] ["depth" <int>] ["nodes" <int>] ["mate" <int>] ["movetime" <int>]

get

<get-command> ::= "get" ("book" | "startpos" | "movelist" | "result" | "pieceplacement" | "boardsize")

isready

<isready-command> ::= "isready"

stop

<stop-command> ::= "stop"

quit

<quit-command> ::= "quit"

4 Commands from Engine to GUI

readyok

<readyok-command> ::= "readyok"

acceptdraw

<acceptdraw-command> ::= "acceptdraw"

offerdraw

<offerdraw-command> ::= "offerdraw"

claimdraw

<claimdraw-command> ::= "claimdraw"

resign

<resign-command> ::= "resign"

message

<message-command> ::= "message" ("error" | "comment") <id>

bestmove

<bestmove-command> ::= "bestmove" <move>

info

<info-command> ::= "info" "book" "XCI_null"
<info-command> ::= "info" "book" ("move" <move> (<book-move-info>)*)+

<book-move-info> ::= "winpercentage" <int>
<book-move-info> ::= "playpercentage" <int>
<book-move-info> ::= "count" <int>
<book-move-info> ::= "wins" <int>
<book-move-info> ::= "losses" <int>
<book-move-info> ::= "draws" <int>
<book-move-info> ::= "annotation" <annotation>
<book-move-info> ::= "score" <score>
<book-move-info> ::= <custom-info>

<info-command> ::= "info" "startpos" (<position> | "XCI_null")
<info-command> ::= "info" "movelist" (<move-list> | "XCI_null")
<info-command> ::= "info" "result" (<result> | "XCI_null")
<info-command> ::= "info" "pieceplacement" (<pieceplacement> | "XCI_null")
<info-command> ::= "info" "boardsize" ((<int> "x" <int>) | "XCI_null")

<info-command> ::= "info" (<pv-info>)* (<status-info>)* (<custom-info>)* ["string" <string>]
<info-command> ::= "pondermove" <move>

<pv-info> ::= "depth" <int>
<pv-info> ::= "seldepth" <int>
<pv-info> ::= "time" <int>
<pv-info> ::= "nodes" <int>
<pv-info> ::= "pv" <move-list>
<pv-info> ::= "multipv" <int> <move-list>
<pv-info> ::= "hashpv" <move-list>
<pv-info> ::= <score>

<status-info> ::= "currmove" <move>
<status-info> ::= "currmovenumber" <int>
<status-info> ::= "refutation" <move> <move-list>
<status-info> ::= "currline" <int> <move-list>
<status-info> ::= "currline" <move-list>
<status-info> ::= "hashfull" <int>
<status-info> ::= "nps" <int>
<status-info> ::= "tbhits" <int>
<status-info> ::= "cpuload" <int>

5 Options File and Translations

option

<option-command> ::= "option" "name" <id> "type" <option-type> "description" <id>

<option-type> ::= "check" "default" ("true" | "false")
<option-type> ::= "spin" "default" <int> "min" <int> "max" <int>
<option-type> ::= "combo" "default" <id> ("var" <id>)+
<option-type> ::= "button" ("input" <id>)* ["output"]
<option-type> ::= "string" ["default" <string>]
<option-type> ::= "searchpath" ["default" <searchpath>]
<option-type> ::= "filename" ["default" <string>]

<input-type> ::= "input" "name" <id> "type" <option-type> "prompt" <id>

info

<info-command> ::= "info" "name" <id> "description" <id>

message

<message-command> ::= "message" "name" <id>

translation

<translation-command> ::= <id> <string>

6 Standard Options/IDs

Options

IDs