@jutge.org/toolkit

中文文档
4.4.53发布于 2026/11/01ES Module

Toolkit to prepare problems for Jutge.org

原始使用文档
文档目录14 节
  1. Key Features
  2. Documentation
  3. Installation
  4. Quick Install
  5. Getting Started
  6. Quick Start
  7. Flow Overview
  8. Common Commands
  9. Requirements
  10. Core Requirements
  11. Optional Dependencies
  12. Support
  13. License
  14. Credits

Jutge Toolkit

A powerful command-line toolkit for creating and managing programming problems on the Jutge.org platform.

Key Features

  • 📝 Create new problems from scratch or using templates
  • 🤖 Generate problems using JutgeAI
  • 🔧 Compile and test solutions in multiple programming languages
  • 📄 Generate statements in PDF, HTML, Markdown and text formats automatically
  • ✅ Verify solutions against test cases
  • 🎬 Stage problems matching Jutge.org specifications
  • ☁️ Upload and update problems directly to Jutge.org
  • ✨ Beautiful terminal interface with color output and help

Documentation

Installation

The toolkit requires Bun as a JavaScript runtime. Follow the installation guides for your platform:

Quick Install

If you already have Bun installed:

bun install --global @jutge.org/toolkit

Verify the installation:

jtk --version

Getting Started

Quick Start

# Get help
jtk
jtk --help

# Check system dependencies
jtk doctor

# Ask JutgeAI for help (requires API key setup)
jtk ask "How do I create a problem?"

# Clone a template problem interactively
jtk clone

# Generate a new problem with AI
jtk generate problem

# Build problem files
cd my-problem.pbm
jtk make

# Verify a solution (locally)
jtk verify candidate.py

# Upload to Jutge.org
jtk upload

# Submit a solution to Jutge.org
jtk submit candidate.py

For a complete walkthrough, see the Getting Started Guide.

Flow Overview

  1. Create a problem

    • Use jtk clone to start from a template
    • Use jtk generate problem to create with JutgeAI
    • Create problem structure manually if preferred
  2. Edit the problem

    • Modify statements, test cases, and solutions as needed
    • Use jtk generate translations to add multilingual support
    • Use jtk generate solutions to add alternative solutions
    • Use jtk generate generate tests to create test cases generator
  3. Build the problem

    • Run jtk make to build all problem elements (statements, solutions, correct test cases)
  4. Optional: Locally verify candidate solutions

    • Use jtk verify <solution> to test candidate solutions for correctness
  5. Optional: Stage the problem

    • Run jtk stage to stage the files as will be used by Jutge.org
  6. Upload the problem

    • Use jtk upload to publish the problem on Jutge.org

      Remember that Jutge.org does not generate the correct test cases; you must provide them.

  7. Optional: Test a candidate solution by submitting it to Jutge.org

    • Use jtk submit -l <language> <solution> to submit the solution to Jutge.org in a specific language

      In order to submit a candidate solution, you need to have the problem uploaded to Jutge.org. This solution will be judged by Jutge.org and you will get its verdict.

Common Commands

# Configuration
jtk config show                     # View current configuration
jtk config set <key> <value>        # Set a configuration value
jtk config edit                     # Edit configuration file

# Problem Creation
jtk clone [template]                # Clone a template problem
jtk generate problem                # Generate problem with AI
jtk generate translations en es ca  # Add statement translations
jtk generate solutions python cpp   # Generate solutions in other languages

# Building and Testing
jtk make                            # Build all problem elements
jtk make pdf                        # Generate PDF statements only
jtk verify <program>                # Test a solution
jtk lint                            # Lint (analyze for errors and warnings) the problem
jtk clean                           # Clean temporary files

# Staging
jtk stage                           # Stage problem for Jutge.org

# Publishing
jtk upload                          # Upload problem to Jutge.org

# Removing
jtk remove                          # Remove problem from Jutge.org

# Testing
jtk submit -l en candidate.py       # Submit a candidate solution to Jutge.org

# Sharing settings
jtk share                           # Show and update sharing settings (passcode, testcases, solutions)
jtk share --passcode <code>         # Set a passcode
jtk share --no-passcode             # Clear the passcode
jtk share --testcases               # Share testcases
jtk share --solutions               # Share solutions

# Maintenance
jtk upgrade                         # Update to latest version
jtk doctor                          # Check system dependencies
jtk about                           # Show toolkit information

Requirements

Core Requirements

  • Bun - JavaScript runtime (required)

Optional Dependencies

  • LaTeX (for PDF generation) - texlive-xetex, texlive-fonts-recommended
  • Pandoc (for format conversion)
  • Programming language compilers/interpreters - Python, GCC/G++, Java, etc. (depending on your needs)

Run jtk doctor to check which dependencies are installed on your system.

Support

  • Documentation: Check the docs folder for detailed guides
  • Get Help: Use jtk ask "your question" to get AI-powered assistance
  • Issues: Report bugs and feature requests on GitHub Issues
  • Community: Visit Jutge.org for the problem platform

License

Apache License 2.0

Credits

© Universitat Politècnica de Catalunya - BarcelonaTech (UPC), 2026.

版本与发布记录

@jutge.org/toolkit 共发布 82 个版本,首次发布于 2026/01/09;过去 12 个月发布了 82 个版本。

版本发布日期距今
4.4.53latest2026/11/011 天前
4.4.522026/10/313 天前
4.4.512026/10/2410 天前
4.4.502026/10/1519 天前
4.4.482026/09/281 个月前
4.4.462026/06/174 个月前

关于 @jutge.org/toolkit 的常见问题

@jutge.org/toolkit 是什么?

工具包,为Jutge.org准备问题

如何安装 @jutge.org/toolkit?

在项目目录运行 npm install @jutge.org/toolkit,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typescript(^7.0.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 jtk、jtk-dev、jutge-toolkit,可以用 npx jtk 直接运行。

@jutge.org/toolkit 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/jutge.org__toolkit 是否存在。

@jutge.org/toolkit 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@jutge.org/toolkit 可以商用吗?

@jutge.org/toolkit 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@jutge.org/toolkit 还在维护吗?

最新版本 4.4.53 发布于 2026/11/01(1 天前);至今共发布 82 个版本,其中过去 12 个月发布了 82 个;首次发布于 2026/01/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。