Skip to content
Dan Riddell edited this page Aug 5, 2026 · 2 revisions

CLI

gambit [flags]

Headless by default — every move is logged to the terminal in algebraic notation.


Flags

Flag Default Description
--white <agent> minimax White agent strategy
--black <agent> random Black agent strategy
--depth <n> 4 Search depth/horizon for depth-limited agents
--seed <n> current time RNG seed for stochastic agents
--fen <fen> standard start Starting position
--delay <duration> 400ms Pause between moves in the GUI

See Agents for the strategy names accepted by --white and --black.

--seed defaults to the current time, so stochastic agents differ run to run. Pass an explicit seed to make a game reproducible.

--delay only affects the GUI — headless runs are not paced.


GUI build

The window lives behind the ebiten build tag. A plain go build or go install gives you the headless binary.

# from a checkout
just gui

# or build it yourself
go build -tags ebiten ./cmd/gambit

The Homebrew cask ships the GUI build; the formula ships the headless CLI.

Playing against an agent

Set a side to human in the GUI build, then click a piece and a destination:

just gui -- --white human --black minimax

Linux system libraries

The window needs OpenGL/X11. On Debian/Ubuntu:

sudo apt install libgl1-mesa-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev

Examples

# Terminal game, default pairing
just run

# Start from a specific position
gambit --fen "r1bqkbnr/pppp1ppp/2n5/4p3/2B1P3/5Q2/PPPP1PPP/RNB1K1NR w KQkq - 4 4"

# Deeper search, reproducible
gambit --white minimax --black minimax --depth 6 --seed 1

# Watch it slowly
just gui -- --delay 1s

Development

just test     # tests
just perft    # move-generation correctness
just lint     # golangci-lint
just demos    # regenerate demo GIFs

Clone this wiki locally