Participant-focused command-line client for the HPCGame and AOI Online Judge Platform. It discovers the files required by an AOI problem, packages matching files from the current directory, submits them, follows judge state changes, saves the result, and prints a compact summary.
Node.js 22 or newer and pnpm are required.
Install the published package:
npm add --global @lcpu/hpcgame-cliFor local development:
corepack enable
pnpm install
pnpm build
pnpm link --globalThe installed command is hpcgame.
Browser/device login delegates authentication to the AOI web interface, so the browser can use IAAA without exposing PKU credentials to this CLI:
hpcgame loginThe default device app ID is 77db0551-125b-4438-afd7-ecf918dec46f. A different AOI OAuth app
with device flow enabled can be selected when needed:
hpcgame login --app-id OTHER-APP-UUIDOther supported methods:
hpcgame login --method mail --email user@example.edu
hpcgame login --method tokenTokens are stored per server in ${XDG_CONFIG_HOME:-~/.config}/hpcgame/config.json. The
directory and file are restricted to the current user. Tokens, OTPs, authorization codes, and
presigned URLs are never printed.
Run the command in a directory containing every file named by the problem's form configuration:
cd my-solution
hpcgame submit \
https://hpcgame.pku.edu.cn/org/2df8f692-0316-4682-80cd-591732b1eda6/problem/a2a1a3f1-722b-42a4-bac9-3170ce069dbbURLs may have extra path segments, query parameters, or fragments. For example, this is also accepted:
https://hpcgame.pku.edu.cn/org/2df8f692-0316-4682-80cd-591732b1eda6/problem/a2a1a3f1-722b-42a4-bac9-3170ce069dbb/submit
The URL remains safe and unambiguous only when it contains one unique valid UUID following an
org segment and one unique valid UUID following a problem segment.
The CLI:
- fetches the problem and prints its required paths, such as
cc.cuand1.py; - validates that each path is a regular file safely contained beneath the working directory;
- creates the same form ZIP shape used by AOI's web client;
- hashes, uploads, and submits it;
- polls until AOI reports
Completed; - downloads judge details when policy permits;
- writes a filename-safe UTC timestamp such as
result/2026-07-31T05-17-18.123Z+<solution-id>.json, containing{ "solution": ..., "details": ... }.
Useful options:
-C, --cwd <directory> read submission files from another directory
-s, --server <origin> require the problem URL to match an origin
--poll-interval <milliseconds> polling interval (default: 1500, minimum: 100)
--private prefer a private runner
Only standard, non-contest form submissions are supported. Direct file-upload and folder-upload problems are reported but not submitted automatically.
pnpm check