The CLI lives in src/cli/. It’s Python under the hood, but you invoke it as nextjudge. Good for scripting problem sets, CI smoke tests, or avoiding the browser when you’re already in a terminal anyway.
Install
Section titled “Install”Add the bin directory to your PATH (replace with your clone location):
export REPO_ROOT=/opt/nextjudgeexport PATH="$REPO_ROOT/src/cli/bin:$PATH"Add those lines to your shell profile if you use the CLI often.
Optional Python deps for uploads and extras:
pip install -r src/cli/requirements.txtCommands
Section titled “Commands”Download a problem
Section titled “Download a problem”nextjudge get 1Writes the prompt and public test cases into the current directory. Creates .nextjudge.env with the problem ID so later commands know context.
Test locally
Section titled “Test locally”Runs your solution against public tests in the same Docker environment as production judges. Requires Docker.
nextjudge test solution.pyIf local tests pass and remote submission fails, the bug is usually environment drift (wrong language ID, missing newline in output) not your algorithm.
Submit
Section titled “Submit”nextjudge submit solution.pyUses the problem ID from .nextjudge.env. Override with --id 42 if you’re in the wrong directory.
You’ll need credentials configured for the target instance (see the CLI source for env vars your deployment uses).
Typical loop
Section titled “Typical loop”nextjudge get 3# read prompt.md, edit solution.pynextjudge test solution.pynextjudge submit solution.pyFast iteration: test locally until green, submit once. Saves queue time and keeps the leaderboard less embarrassing.
When to skip the CLI
Section titled “When to skip the CLI”Use the web editor if you want live custom input runs, language switching, or contest context. The CLI is for file-based workflows and automation, not replacing the UI entirely.