360 Secure SkillHub
360 安全技能中心

boardgamearena-fpx

借助 fpx CLI 和浏览器扩展复用已登录的 Board Game Arena 标签页,读取桌台列表、单桌记录、实时对局状态、日志与分数,并按请求格式提交走子;走子采用先预览、用户确认后才发送的门控流程,且仅限友好/非排名桌。

分类:生活
chrischall
chrischall
热度 40.96
最近更新 2026-12-02 22:49:39

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add chrischall/boardgamearena-fpx
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
boardgamearena-fpx
description
Read and play your Board Game Arena (boardgamearena.com, BGA) games from a shell — the tables you are playing, one table's record (ranked or not, players, progression), a game's live state (current state, whose turn, the choices on offer, scores, the game's own fields such as Can't Stop's columns), and the game log — through your signed-in BGA browser tab with the fpx CLI; plus confirm-gated move submission (preview first, send only after the user says yes) for Can't Stop, Pickomino, Downforce, 6 nimmt! or any game's action. Use when asked about Board Game Arena, BGA tables, whose turn it is, a Can't Stop / Pickomino / Downforce / 6 nimmt! game, or to make a move at a friendly / unranked BGA table.

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.

  1. bga_move <id> <action> [k=v…] — a preview only: the table's ranked flag, the current state, whether that state lists the action (action_listed), and the request it would send. Nothing is sent.
  2. 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…].
  3. A move is sent once — never resent automatically. If it fails with anything but a refusal (code 6), it may have been played: re-read bga_gamedatas before trying again.

Action names and arguments per game, and every request with jq recipes, are in references/requests.md.