Skip to main content

CLI client for judge.nitro-ai.org

Project description

Nitro CLI

CLI client for judge.nitro-ai.org.

Features

  • login using Playwright plus Nitro credentials
  • list contests with page controls
  • list tasks for a contest
  • view full task statements
  • submit solutions and wait for feedback
  • list submissions
  • inspect submission feedback/details
  • interactive shell mode when run without arguments

Requirements

  • Python 3.10+
  • Playwright is installed as a package dependency

Login

nitro-cli login opens a real browser session using Playwright to obtain Cloudflare clearance, then completes the Nitro login flow automatically.

Behavior:

  1. reuses saved session if still valid
  2. reuses saved cf_clearance when possible
  3. opens a browser if a fresh Cloudflare clearance is needed
  4. retries login automatically if the saved clearance expired

On first use, nitro-cli may install the Playwright Chromium browser.

Browser behavior:

  • headless by default, so no browser window flashes
  • to force a visible browser for debugging:
NITRO_BROWSER_HEADLESS=0 nitro-cli login

Example:

nitro-cli login --username MihneaStoica --password '...'

Installation

With pipx:

pipx install .

With pip:

python3 -m pip install .

For local development:

python3 -m pip install -e .

From PyPI:

pipx install nitro-ai-judge-cli

Usage

Direct commands:

nitro-cli login
nitro-cli contests
nitro-cli contests --page 2
nitro-cli contests --all-pages
nitro-cli tasks algolymp/algolymp-preojia-ix-x
nitro-cli task algolymp/algolymp-preojia-ix-x 1
nitro-cli submissions algolymp/algolymp-preojia-ix-x 1 --mode both
nitro-cli submission 3a009d767bd5 --org algolymp --comp algolymp-preojia-ix-x --task-id 1
nitro-cli submit algolymp/algolymp-preojia-ix-x 1 --output submission.csv --source solution.py --wait

Interactive shell:

nitro-cli

Example shell session:

contest list
contest list --page 2
contest list --all-pages
select 20
tasks
select 1
show
submit submission.csv solution.py --wait
submissions
submission 1

Shell commands:

help
exit | quit
back | unselect
login [username] [password]
status
contests
contest list [--all] [--page N] [--page-size N] [--all-pages]
contest select <index|org/slug>
contest show
tasks
task list
task select <index|id>
select <index|id>
show
submit <output.csv> [source.py] [--note TEXT] [--wait]
task show
task submit <output.csv> [source.py] [--note TEXT] [--wait]
submissions [--mode partial|complete|both]
task submissions list [--mode partial|complete|both]
submission <index|short-id|full-id>
submission view <index|short-id|full-id>
task submissions show <index|short-id|full-id>
set-final <index|short-id|full-id>
unset-final <index|short-id|full-id>

Notes:

  • select is context-sensitive: at top level it selects a contest; inside a contest it selects a task.
  • back / unselect clears the current task first, then the current contest.

State

Login state is stored in:

~/.nitro-cli/state.json

Override with:

NITRO_STATE_DIR=/some/path nitro-cli login

Publishing

This repo includes a GitHub Actions workflow at .github/workflows/publish.yml.

Behavior:

  1. Builds the package on pushes, pull requests, and manual runs
  2. Runs twine check on built distributions
  3. Publishes to PyPI when you push a tag matching v*

Recommended release flow:

python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine check dist/*
# bump version in pyproject.toml before tagging a new release
git tag v0.1.2
git push origin main --tags

PyPI does not allow re-uploading the same filename for an existing release. The workflow is configured to skip already-published files on reruns, but publishing a new release still requires a new version in pyproject.toml and a matching new tag.

For PyPI trusted publishing, configure PyPI to trust this GitHub repository and the pypi environment.

Package name on PyPI: nitro-ai-judge-cli Command name after install: nitro-cli

Before publishing publicly, choose and add a license file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nitro_ai_judge_cli-0.1.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nitro_ai_judge_cli-0.1.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file nitro_ai_judge_cli-0.1.2.tar.gz.

File metadata

  • Download URL: nitro_ai_judge_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nitro_ai_judge_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b311cfda2127083d05796120ac3600c47f9ea0abdeb89a0207a2b77765622900
MD5 8d92f9cb7e9b2a5ad8c9bf615638fe07
BLAKE2b-256 0dd1839ff86b6583a443b6ae92eb22c417f3f678e3051b442ac886004963838f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_ai_judge_cli-0.1.2.tar.gz:

Publisher: publish.yml on MihneaTeodorStoica/nitro-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nitro_ai_judge_cli-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nitro_ai_judge_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c21575378b47598a539d58c62f929f98a858c41013680f1b8ab632a099857764
MD5 f388c8413cccd00c39366441f29055e7
BLAKE2b-256 88ce424a3a089342772c786bd9176e675ac5cd1350df7bd5fa770306f46bf997

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_ai_judge_cli-0.1.2-py3-none-any.whl:

Publisher: publish.yml on MihneaTeodorStoica/nitro-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page