Skip to content

CLI

Download problems, test locally, and submit from the terminal.

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.

Add the bin directory to your PATH (replace with your clone location):

Terminal window
export REPO_ROOT=/opt/nextjudge
export 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:

Terminal window
pip install -r src/cli/requirements.txt
Terminal window
nextjudge get 1

Writes the prompt and public test cases into the current directory. Creates .nextjudge.env with the problem ID so later commands know context.

Runs your solution against public tests in the same Docker environment as production judges. Requires Docker.

Terminal window
nextjudge test solution.py

If local tests pass and remote submission fails, the bug is usually environment drift (wrong language ID, missing newline in output) not your algorithm.

Terminal window
nextjudge submit solution.py

Uses 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).

Terminal window
nextjudge get 3
# read prompt.md, edit solution.py
nextjudge test solution.py
nextjudge submit solution.py

Fast iteration: test locally until green, submit once. Saves queue time and keeps the leaderboard less embarrassing.

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.