Board Game Arena via fpx
Ranked play: outside assistance in RANKED Board Game Arena games breaks BGA's
rules. Give advice and make moves only at friendly / unranked tables; when a table
is ranked, say so and do not help with the game. Ranked = game option 201
("Game mode": 0 Normal, 1 Friendly, 2 Arena) is not "1" — a Friendly table still
shows unranked: "0", so that field is only the fallback.
BGA's session lives in the browser, so every call rides your signed-in BGA tab
through the ContextMint Bridge extension and the fpx CLI
(npm i -g @fetchproxy/cli). jq is needed too.
One-time setup
fpx profile add bga --domain boardgamearena.com
fpx get https://boardgamearena.com/gameinprogress -p bga >/dev/null # prints a pair code on stderr
No cookie or header scopes are needed (the request token is read from the page), so
nothing has to be declared before pairing. Approve the pair code in the ContextMint
Bridge popup of the browser where you are signed in to BGA. If a second browser
also runs the extension, every call prints a fresh pair code on stderr while stdout
still carries the data — that is the other browser being turned away; do not approve
it (fpx trust list shows the pin, fpx trust clear fpx-bga re-pairs).
Call pattern
Source the helper (bash or zsh). It reads the session's request token once from a
signed-in page and adds the headers BGA's XHR endpoints need (X-Request-Token +
X-Requested-With: XMLHttpRequest); a refused token is re-read once for reads.
Run bga_init on its own first: a function on the left of a | runs in a subshell,
so a token it reads there is lost and every piped call would re-read the page.
source <this skill's dir>/scripts/bga.sh # e.g. ~/.claude/skills/boardgamearena-fpx/scripts/bga.sh
bga_init # once per shell, NOT in a pipe
bga_tables | jq '[.data.tables | to_entries[] | .value | {id, game: .game_name, ranked: ((.options["201"] | tostring) != "1" and .unranked == "0")}]'
bga_gamedatas 812345678 | jq '.data.data as $d | {state: $d.gamestates[($d.gamestate.id | tostring)].name, active: $d.gamestate.active_player, args: $d.gamestate.args}'
| Function | Request |
|---|---|
bga_tables [status] |
your tables (default play; the only status verified) |
bga_table <id> |
one table record |
bga_gamedatas <id> |
the game state (.data.data); resolves the game server + game from the table |
bga_history <id> [from] |
the game log (.data.data[]) |
bga_get <path> [k=v…] |
any BGA XHR path, relative to https://boardgamearena.com/ |
bga_move [--send] <id> <action> [k=v…] |
a move — preview, or send once (below) |
bga_init |
re-read the token; sets BGA_TOKEN, BGA_USER_ID |
Output is BGA's raw JSON envelope: {status: 1, data}. Return codes: 0 ok · 1
usage · 2 bridge down · 3 bot wall · 4 upstream HTTP error (body on stdout) ·
5 not signed in to BGA in the paired browser (or the token was refused) · 6 BGA
refused the request ({status: "0", error} on stdout, the error on stderr).
Resolve first. Everything takes a numeric table id: get it from bga_tables
(or a table link, …?table=<id>), then read the state before advising or moving.
Moves — confirm-gated
The request format and Can't Stop's actDiceChoice / actContinueChoice were
verified live on 2026-12-01 (a whole hot-seat game). Every other action name
comes from the games' own client code only: make the first one at an unranked /
friendly table and check the game page afterwards.
bga_move <id> <action> [k=v…]— a preview only: the table'srankedflag, the currentstate, whether that state lists the action (action_listed), and the request it would send. Nothing is sent.- Show the preview to the user. If the table is ranked, stop. Send only after the
user says yes:
bga_move --send <id> <action> [k=v…]. - A move is sent once — never resent automatically. If it fails with anything
but a refusal (code
6), it may have been played: re-readbga_gamedatasbefore trying again.
Action names and arguments per game, and every request with jq recipes, are in
references/requests.md.
