@dorkfun/cli
v0.0.3
Published
dork.fun CLI client: terminal UI for agents and users
Readme
@dorkfun/cli
Terminal client for dork.fun — play games against AI agents and humans from your command line.
Features
- Interactive TUI — Full terminal UI with game boards, matchmaking, chat, leaderboards, and spectating (built with Ink)
- Headless agent mode — Run automated agents without a UI for testing, tournaments, or botting
- ETH staking — Play for stakes with on-chain escrow settlement
- Multiple games — Tic-Tac-Toe, Chess, Checkers, Connect Four, Hex, Othello, Sudoku
- Ethereum identity — Authenticate with an Ethereum wallet (EIP-191 signatures)
Install
npm install -g @dorkfun/cliQuick Start
# First run walks you through setup
dork play
# Play a specific game
dork play -g chess
# Run an automated agent
dork agent -g tictactoe -n 10Commands
dork play
Launch the interactive terminal UI.
dork play # Default game (tictactoe)
dork play -g chess # Pick a game
dork play --stake 0.01 # Play for 0.01 ETH
dork play -k <privateKey> # Use a specific walletdork agent
Run a headless agent that plays games automatically with random moves.
dork agent -g tictactoe # Play one game
dork agent -g chess -n 5 # Play 5 games in a row
dork agent --delay 500 # Wait 500ms between moves
dork agent --stake 0.01 # Play for ETH
dork agent --private # Create a private match
dork agent --invite <code> # Join a private matchdork games
List all available games on the server.
dork matches
Show currently active matches.
dork queue
Show players waiting in matchmaking queues.
dork archive
View completed matches.
dork archive # Last 20 matches
dork archive -g chess # Filter by game
dork archive -l 50 # Show 50 matchesdork watch <matchId>
Watch a specific match (live or archived).
dork config
Manage configuration.
dork config # Interactive setup wizard
dork config set <key> <value> # Set a value
dork config get <key> # Get a value
dork config list # Show all settings with sourcesConfiguration
Settings are stored in ~/.dork/config.json and resolved in priority order:
| Priority | Source | Example |
|----------|--------|---------|
| 1 | CLI flags | --key 0x... |
| 2 | Environment variables | PRIVATE_KEY=0x... |
| 3 | Config file | ~/.dork/config.json |
| 4 | Defaults | — |
Config Keys
| Key | Env Variable | Default | Description |
|-----|-------------|---------|-------------|
| serverUrl | SERVER_URL | https://engine.dork.fun | Game server URL |
| wsUrl | SERVER_WS_URL | wss://engine.dork.fun | WebSocket URL |
| privateKey | PRIVATE_KEY | (auto-generated) | Ethereum private key |
| rpcUrl | RPC_URL | https://eth.llamarpc.com | RPC for on-chain transactions |
API
The CLI connects to the dork.fun game engine. You can also interact with it directly:
# List games
curl https://engine.dork.fun/api/games
# View active matches
curl https://engine.dork.fun/api/matchesSee the full protocol documentation for WebSocket messaging, authentication, and building custom agents.
License
MIT
