@jutge.org/toolkit 4.2.4 → 4.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # Jutge Toolkit - Getting Started Guide
2
2
 
3
- Welcome to the New Jutge Toolkit! This guide will help you install and start using the toolkit to create, manage, and upload programming problems to Jutge.org. Information about problem formats will be provided in a separate document.
3
+ Welcome to the New Jutge Toolkit! This guide will help you start using the toolkit to create, manage, and upload programming problems to Jutge.org. Information about problem formats will be provided in a separate document.
4
4
 
5
5
  ## What is Jutge Toolkit?
6
6
 
@@ -14,196 +14,11 @@ Jutge Toolkit is a command-line application that helps you create and manage pro
14
14
 
15
15
  ## Installation
16
16
 
17
- Choose the installation instructions for your operating system:
17
+ For installation instructions, please refer to the guide for your operating system:
18
18
 
19
- ### Linux Installation
20
-
21
- 1. **Install Bun (JavaScript runtime)**
22
-
23
- Open a terminal and run:
24
-
25
- ```bash
26
- curl -fsSL https://bun.sh/install | bash
27
- ```
28
-
29
- After installation, close and reopen your terminal, or run:
30
-
31
- ```bash
32
- source ~/.bashrc
33
- ```
34
-
35
- 2. **Install Jutge Toolkit**
36
-
37
- ```bash
38
- bun install --global "@jutge.org/toolkit"
39
- ```
40
-
41
- 3. **Verify installation**
42
-
43
- ```bash
44
- jtk --version
45
- ```
46
-
47
- You should see the version number displayed.
48
-
49
- 4. **Check dependencies**
50
-
51
- ```bash
52
- jtk doctor
53
- ```
54
-
55
- This command will show which tools are installed on your system. Don't worry if some are missing - you only need to install the ones for the programming languages and features you plan to use.
56
-
57
- 5. **Install recommended dependencies (optional)**
58
-
59
- Depending on your needs, you may want to install:
60
- - **LaTeX** (for PDF statements):
61
-
62
- ```bash
63
- sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-lang-european
64
- ```
65
-
66
- - **Pandoc** (for converting statements to different formats):
67
-
68
- ```bash
69
- sudo apt-get install pandoc
70
- ```
71
-
72
- - **Python 3** (if using Python in your problems):
73
-
74
- ```bash
75
- sudo apt-get install python3
76
- ```
77
-
78
- - **GCC/G++** (if using C/C++ in your problems):
79
- ```bash
80
- sudo apt-get install build-essential
81
- ```
82
-
83
- ### macOS Installation
84
-
85
- 1. **Install Bun (JavaScript runtime)**
86
-
87
- Open Terminal and run:
88
-
89
- ```bash
90
- curl -fsSL https://bun.sh/install | bash
91
- ```
92
-
93
- After installation, close and reopen your terminal.
94
-
95
- 2. **Install Jutge Toolkit**
96
-
97
- ```bash
98
- bun install --global "@jutge.org/toolkit"
99
- ```
100
-
101
- 3. **Verify installation**
102
-
103
- ```bash
104
- jtk --version
105
- ```
106
-
107
- You should see the version number displayed.
108
-
109
- 4. **Check dependencies**
110
-
111
- ```bash
112
- jtk doctor
113
- ```
114
-
115
- This command will show which tools are installed on your system.
116
-
117
- 5. **Install recommended dependencies (optional)**
118
-
119
- We recommend using Homebrew to install additional tools. If you don't have Homebrew, install it first:
120
-
121
- ```bash
122
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
123
- ```
124
-
125
- Then install the tools you need:
126
- - **LaTeX** (for PDF statements):
127
-
128
- ```bash
129
- brew install --cask mactex
130
- ```
131
-
132
- - **Pandoc** (for converting statements):
133
-
134
- ```bash
135
- brew install pandoc
136
- ```
137
-
138
- - **Python 3** (if using Python):
139
-
140
- ```bash
141
- brew install python3
142
- ```
143
-
144
- - **C/C++ Compiler** (if using C/C++):
145
-
146
- macOS comes with Clang compiler. Install Xcode Command Line Tools:
147
-
148
- ```bash
149
- xcode-select --install
150
- ```
151
-
152
- ### Windows Installation
153
-
154
- 1. **Open PowerShell**
155
-
156
- Press Windows key, type "PowerShell", and open it. Remember to reopen PowerShell after installing each tool.
157
-
158
- 2. **Install Bun (JavaScript runtime)**
159
-
160
- Visit https://bun.sh/ and follow the installation instructions for Windows. It is easy!
161
-
162
- 3. **Install Jutge Toolkit**
163
-
164
- ```powershell
165
- bun install --global "@jutge.org/toolkit"
166
- ```
167
-
168
- The first installation may take a while. If it fails with a `mkdir` error, try again - it's usually a transient error.
169
-
170
- 4. **Verify installation**
171
-
172
- ```powershell
173
- jtk --version
174
- ```
175
-
176
- You should see the version number displayed.
177
-
178
- 5. **Check dependencies**
179
-
180
- ```powershell
181
- jtk doctor
182
- ```
183
-
184
- This command will show which tools are installed on your system.
185
-
186
- 6. **Install recommended dependencies (optional)**
187
- - **LaTeX** (for PDF statements):
188
-
189
- Install MiKTeX from https://miktex.org/download. During installation, select the option to install missing packages on-the-fly.
190
-
191
- - **Pandoc** (for converting statements):
192
-
193
- ```powershell
194
- winget install --id JohnMacFarlane.Pandoc
195
- ```
196
-
197
- - **Python 3** (if using Python):
198
-
199
- Install from https://www.python.org/downloads/windows/. Make sure to check "Add Python to PATH" during installation.
200
-
201
- - **C/C++ Compiler** (if using C/C++):
202
-
203
- We recommend w64devkit:
204
- 1. Download from https://github.com/skeeto/w64devkit/releases
205
- 2. Extract to a folder (e.g., `C:\w64devkit`)
206
- 3. Run `w64devkit.exe` to open a terminal with GCC available
19
+ - [Linux Installation Guide](link-to-linux-guide)
20
+ - [macOS Installation Guide](link-to-macos-guide)
21
+ - [Windows Installation Guide](link-to-windows-guide)
207
22
 
208
23
  ## Getting Started
209
24
 
@@ -231,14 +46,14 @@ Before we dive into configuration, it's important to know how to get help:
231
46
 
232
47
  3. **Get help using JutgeAI:**
233
48
 
234
- You can ask questions about the toolkit in human language using the `ask` command and get answers generated by JutgeAI and formatted in arkdown:
49
+ You can ask questions about the toolkit in human language using the `ask` command and get answers generated by JutgeAI and formatted in markdown:
235
50
 
236
51
  ```bash
237
52
  jtk ask "How to create a new problem?"
238
- jtk ask "Com puc crear un problema nou?" --model "google/gemini-2.5-flash-lite"
53
+ jtk ask "Com puc crear un problema nou?" --model "openai/gpt-5-nano"
239
54
  ```
240
55
 
241
- For this to work, you need to have set up an AI API key (see "Setting Up AI Features" below).
56
+ For this to work, you need to have set up an AI API key (see your platform-specific installation guide).
242
57
 
243
58
  4. **View information about the toolkit:**
244
59
 
@@ -270,41 +85,6 @@ Before using the toolkit, you should configure it with your preferences:
270
85
 
271
86
  This opens your default text editor with the configuration file.
272
87
 
273
- ### Setting Up AI Features (Optional)
274
-
275
- If you want to use JutgeAI features to generate problems and content, you need to set up API keys:
276
-
277
- **For Google Gemini (Free for UPC users):**
278
-
279
- 1. Visit https://aistudio.google.com/ and sign in
280
- 2. Click "Get API key" in the sidebar
281
- 3. Click "Create API key"
282
- 4. Copy the generated key
283
- 5. Set the environment variable:
284
- - **Linux/macOS:** Add to `~/.bashrc` or `~/.zshrc`:
285
- ```bash
286
- export GEMINI_API_KEY="your-key-here"
287
- ```
288
- - **Windows PowerShell (permanent):**
289
- ```powershell
290
- [System.Environment]::SetEnvironmentVariable('GEMINI_API_KEY', 'your-key-here', 'User')
291
- ```
292
-
293
- **For OpenAI (Paid):**
294
-
295
- 1. Create an account at https://platform.openai.com/
296
- 2. Navigate to API Keys section
297
- 3. Create a new secret key
298
- 4. Set the environment variable:
299
- - **Linux/macOS:** Add to `~/.bashrc` or `~/.zshrc`:
300
- ```bash
301
- export OPENAI_API_KEY="your-key-here"
302
- ```
303
- - **Windows PowerShell (permanent):**
304
- ```powershell
305
- [System.Environment]::SetEnvironmentVariable('OPENAI_API_KEY', 'your-key-here', 'User')
306
- ```
307
-
308
88
  ### Your First Problem
309
89
 
310
90
  #### Option 1: Create from Template
@@ -315,12 +95,12 @@ If you want to use JutgeAI features to generate problems and content, you need t
315
95
  jtk clone
316
96
  ```
317
97
 
318
- This will show you available templates and create a new problem directory.
98
+ This will show you available templates and create a new problem directory under `./new-problem.pbm`.
319
99
 
320
- 2. **Or clone a specific template:**
100
+ 2. **Or clone a specific template and place it into a particular directory:**
321
101
 
322
102
  ```bash
323
- jtk clone standard/maximum-of-2-integers.pbm -d my-problem.pbm
103
+ jtk clone standard/maximum-of-2-integers.pbm -d my-new-problem.pbm
324
104
  ```
325
105
 
326
106
  #### Option 2: Create with AI
@@ -328,7 +108,7 @@ If you want to use JutgeAI features to generate problems and content, you need t
328
108
  1. **Create a problem using JutgeAI:**
329
109
 
330
110
  ```bash
331
- jtk generate problem -d factorial.pbm
111
+ jtk generate problem
332
112
  ```
333
113
 
334
114
  The toolkit will ask you for:
@@ -337,14 +117,18 @@ If you want to use JutgeAI features to generate problems and content, you need t
337
117
  - Original language
338
118
  - Programming language for the solution
339
119
 
340
- 2. **Review the generated content** in the `factorial.pbm` directory.
120
+ Be specific about the problem description. Here is a possible example:
121
+
122
+ > The task is to read all numbers in the input and print how much of them are prime numbers. Add a cute, short story around it. The input will only contain natural numbers less than 2^32-1.
123
+
124
+ 2. **Review the generated content** in the `my-problem.pbm` directory.
341
125
 
342
126
  ### Building Your Problem
343
127
 
344
128
  Once you have a problem directory, you can generate all necessary files:
345
129
 
346
130
  ```bash
347
- cd factorial.pbm
131
+ cd my-problem.pbm
348
132
  jtk make
349
133
  ```
350
134
 
@@ -353,14 +137,15 @@ This command will:
353
137
  - Compile solutions
354
138
  - Generate correct outputs for test cases
355
139
  - Create PDF statements
356
- - Generate HTML and text versions
140
+ - Generate HTML, Markdown and Text versions of the statements
357
141
 
358
142
  To make only specific elements:
359
143
 
360
144
  ```bash
361
- jtk make pdf # Only PDF statements
362
145
  jtk make exe # Only compile executables
363
146
  jtk make cor # Only generate correct outputs
147
+ jtk make pdf # Only PDF statements
148
+ jtk make html # Only HTML statements
364
149
  ```
365
150
 
366
151
  ### Testing Solutions
@@ -368,7 +153,7 @@ jtk make cor # Only generate correct outputs
368
153
  To verify a solution against your golden solution:
369
154
 
370
155
  ```bash
371
- jtk verify solution.py
156
+ jtk verify candidate.py
372
157
  ```
373
158
 
374
159
  This will run the solution against all test cases and compare outputs.
@@ -384,7 +169,7 @@ jtk generate translations en es ca
384
169
  **Add solutions in other languages:**
385
170
 
386
171
  ```bash
387
- jtk generate solutions python java cpp
172
+ jtk generate solutions python java cc
388
173
  ```
389
174
 
390
175
  **Generate test case generators:**
@@ -423,7 +208,7 @@ When your problem is ready:
423
208
  jtk upload
424
209
  ```
425
210
 
426
- If this is a new problem, it will be created on Jutge.org and a `problem.yml` file will be generated with the problem ID. For subsequent uploads, the problem will be updated.
211
+ If this is a new problem, it will be created on Jutge.org and a `problem.yml` file will be generated with the problem ID. For subsequent uploads, the problem will be updated. Do not modify `problem.yml`!
427
212
 
428
213
  ## Common Commands Reference
429
214
 
@@ -478,31 +263,19 @@ jtk doctor # Check system dependencies
478
263
 
479
264
  ## Troubleshooting
480
265
 
481
- **Command not found after installation:**
482
-
483
- - Close and reopen your terminal
484
- - Check that Bun is properly installed: `bun --version`
485
-
486
- **Permission errors on Linux/macOS:**
487
-
488
- - You may need to add execution permissions to Bun's installation directory
489
-
490
266
  **AI features not working:**
491
267
 
492
268
  - Verify your API keys are set correctly
493
269
  - Check you have internet connectivity
494
270
  - Ensure the model name is correct in your configuration
495
271
 
496
- **LaTeX compilation fails:**
497
-
498
- - Make sure you have a complete LaTeX distribution installed
499
- - On Windows, ensure MiKTeX can install packages automatically
500
-
501
272
  **Problems with specific compilers:**
502
273
 
503
274
  - Run `jtk doctor` to see which compilers are available
504
275
  - Install only the compilers you need for your problems
505
276
 
277
+ For platform-specific troubleshooting, refer to your installation guide.
278
+
506
279
  ---
507
280
 
508
- You're now ready to start creating problems with Jutge Toolkit! If you have questions or need help, don't hesitate to consult the documentation or reach out to the community.
281
+ You're now ready to start creating problems with Jutge Toolkit! If you have questions or need help, don't hesitate to consult the documentation, use the `ask` command or reach out to the community.
@@ -0,0 +1,107 @@
1
+ # Jutge Toolkit - Linux Installation Guide
2
+
3
+ ## Installation Steps
4
+
5
+ ### 1. Install Bun (JavaScript runtime)
6
+
7
+ Open a terminal and run:
8
+
9
+ ```bash
10
+ curl -fsSL https://bun.sh/install | bash
11
+ ```
12
+
13
+ After installation, close and reopen your terminal, or run:
14
+
15
+ ```bash
16
+ source ~/.bashrc
17
+ ```
18
+
19
+ ### 2. Install Jutge Toolkit
20
+
21
+ ```bash
22
+ bun install --global "@jutge.org/toolkit"
23
+ ```
24
+
25
+ ### 3. Verify installation
26
+
27
+ ```bash
28
+ jtk --version
29
+ ```
30
+
31
+ You should see the version number displayed.
32
+
33
+ ### 4. Check dependencies
34
+
35
+ ```bash
36
+ jtk doctor
37
+ ```
38
+
39
+ This command will show which tools are installed on your system. Don't worry if some are missing - you only need to install the ones for the programming languages and features you plan to use.
40
+
41
+ ### 5. Install recommended dependencies (optional)
42
+
43
+ Depending on your needs, you may want to install:
44
+
45
+ - **LaTeX** (for PDF statements):
46
+
47
+ ```bash
48
+ sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-lang-european
49
+ ```
50
+
51
+ - **Pandoc** (for converting statements to different formats):
52
+
53
+ ```bash
54
+ sudo apt-get install pandoc
55
+ ```
56
+
57
+ - **Python 3** (if using Python in your problems):
58
+
59
+ ```bash
60
+ sudo apt-get install python3
61
+ ```
62
+
63
+ - **GCC/G++** (if using C/C++ in your problems):
64
+
65
+ ```bash
66
+ sudo apt-get install build-essential
67
+ ```
68
+
69
+ ## Setting Up AI Features (Optional)
70
+
71
+ If you want to use JutgeAI features to generate problems and content, you need to set up API keys:
72
+
73
+ ### For Google Gemini (Free for UPC users):
74
+
75
+ 1. Visit https://aistudio.google.com/ and sign in
76
+ 2. Click "Get API key" in the sidebar
77
+ 3. Click "Create API key"
78
+ 4. Copy the generated key
79
+ 5. Add to `~/.bashrc` or `~/.zshrc`:
80
+
81
+ ```bash
82
+ export GEMINI_API_KEY="your-key-here"
83
+ ```
84
+
85
+ ### For OpenAI (Paid):
86
+
87
+ 1. Create an account at https://platform.openai.com/
88
+ 2. Navigate to API Keys section
89
+ 3. Create a new secret key
90
+ 4. Add to `~/.bashrc` or `~/.zshrc`:
91
+
92
+ ```bash
93
+ export OPENAI_API_KEY="your-key-here"
94
+ ```
95
+
96
+ ## Troubleshooting
97
+
98
+ **Command not found after installation:**
99
+
100
+ - Close and reopen your terminal
101
+ - Check that Bun is properly installed: `bun --version`
102
+
103
+ **Permission errors:**
104
+
105
+ - You may need to add execution permissions to Bun's installation directory
106
+
107
+ You're ready to use Jutge Toolkit on Linux!
@@ -0,0 +1,111 @@
1
+ # Jutge Toolkit - macOS Installation Guide
2
+
3
+ ## Installation Steps
4
+
5
+ ### 1. Install Bun (JavaScript runtime)
6
+
7
+ Open Terminal and run:
8
+
9
+ ```bash
10
+ curl -fsSL https://bun.sh/install | bash
11
+ ```
12
+
13
+ After installation, close and reopen your terminal.
14
+
15
+ ### 2. Install Jutge Toolkit
16
+
17
+ ```bash
18
+ bun install --global "@jutge.org/toolkit"
19
+ ```
20
+
21
+ ### 3. Verify installation
22
+
23
+ ```bash
24
+ jtk --version
25
+ ```
26
+
27
+ You should see the version number displayed.
28
+
29
+ ### 4. Check dependencies
30
+
31
+ ```bash
32
+ jtk doctor
33
+ ```
34
+
35
+ This command will show which tools are installed on your system.
36
+
37
+ ### 5. Install recommended dependencies (optional)
38
+
39
+ We recommend using Homebrew to install additional tools. If you don't have Homebrew, install it first:
40
+
41
+ ```bash
42
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
43
+ ```
44
+
45
+ Then install the tools you need:
46
+
47
+ - **LaTeX** (for PDF statements):
48
+
49
+ ```bash
50
+ brew install --cask mactex
51
+ ```
52
+
53
+ - **Pandoc** (for converting statements):
54
+
55
+ ```bash
56
+ brew install pandoc
57
+ ```
58
+
59
+ - **Python 3** (if using Python):
60
+
61
+ ```bash
62
+ brew install python3
63
+ ```
64
+
65
+ - **C/C++ Compiler** (if using C/C++):
66
+
67
+ macOS comes with Clang compiler. Install Xcode Command Line Tools:
68
+
69
+ ```bash
70
+ xcode-select --install
71
+ ```
72
+
73
+ ## Setting Up AI Features (Optional)
74
+
75
+ If you want to use JutgeAI features to generate problems and content, you need to set up API keys:
76
+
77
+ ### For Google Gemini (Free for UPC users):
78
+
79
+ 1. Visit https://aistudio.google.com/ and sign in
80
+ 2. Click "Get API key" in the sidebar
81
+ 3. Click "Create API key"
82
+ 4. Copy the generated key
83
+ 5. Add to `~/.bashrc` or `~/.zshrc`:
84
+
85
+ ```bash
86
+ export GEMINI_API_KEY="your-key-here"
87
+ ```
88
+
89
+ ### For OpenAI (Paid):
90
+
91
+ 1. Create an account at https://platform.openai.com/
92
+ 2. Navigate to API Keys section
93
+ 3. Create a new secret key
94
+ 4. Add to `~/.bashrc` or `~/.zshrc`:
95
+
96
+ ```bash
97
+ export OPENAI_API_KEY="your-key-here"
98
+ ```
99
+
100
+ ## Troubleshooting
101
+
102
+ **Command not found after installation:**
103
+
104
+ - Close and reopen your terminal
105
+ - Check that Bun is properly installed: `bun --version`
106
+
107
+ **Permission errors:**
108
+
109
+ - You may need to add execution permissions to Bun's installation directory
110
+
111
+ You're ready to use Jutge Toolkit on macOS!
@@ -0,0 +1,99 @@
1
+ # Jutge Toolkit - Windows Installation Guide
2
+
3
+ ## Installation Steps
4
+
5
+ ### 1. Open PowerShell
6
+
7
+ Press Windows key, type "PowerShell", and open it. Remember to reopen PowerShell after installing each tool.
8
+
9
+ ### 2. Install Bun (JavaScript runtime)
10
+
11
+ Visit https://bun.sh/ and follow the installation instructions for Windows. It is easy!
12
+
13
+ ### 3. Install Jutge Toolkit
14
+
15
+ ```powershell
16
+ bun install --global "@jutge.org/toolkit"
17
+ ```
18
+
19
+ The first installation may take a while. If it fails with a `mkdir` error, try again - it's usually a transient error.
20
+
21
+ ### 4. Verify installation
22
+
23
+ ```powershell
24
+ jtk --version
25
+ ```
26
+
27
+ You should see the version number displayed.
28
+
29
+ ### 5. Check dependencies
30
+
31
+ ```powershell
32
+ jtk doctor
33
+ ```
34
+
35
+ This command will show which tools are installed on your system.
36
+
37
+ ### 6. Install recommended dependencies (optional)
38
+
39
+ - **LaTeX** (for PDF statements):
40
+
41
+ Install MiKTeX from https://miktex.org/download. During installation, select the option to install missing packages on-the-fly.
42
+
43
+ - **Pandoc** (for converting statements):
44
+
45
+ ```powershell
46
+ winget install --id JohnMacFarlane.Pandoc
47
+ ```
48
+
49
+ - **Python 3** (if using Python):
50
+
51
+ Install from https://www.python.org/downloads/windows/. Make sure to check "Add Python to PATH" during installation.
52
+
53
+ - **C/C++ Compiler** (if using C/C++):
54
+
55
+ We recommend w64devkit:
56
+ 1. Download from https://github.com/skeeto/w64devkit/releases
57
+ 2. Extract to a folder (e.g., `C:\w64devkit`)
58
+ 3. Run `w64devkit.exe` to open a terminal with GCC available
59
+
60
+ ## Setting Up AI Features (Optional)
61
+
62
+ If you want to use JutgeAI features to generate problems and content, you need to set up API keys:
63
+
64
+ ### For Google Gemini (Free for UPC users):
65
+
66
+ 1. Visit https://aistudio.google.com/ and sign in
67
+ 2. Click "Get API key" in the sidebar
68
+ 3. Click "Create API key"
69
+ 4. Copy the generated key
70
+ 5. Set the environment variable permanently:
71
+
72
+ ```powershell
73
+ [System.Environment]::SetEnvironmentVariable('GEMINI_API_KEY', 'your-key-here', 'User')
74
+ ```
75
+
76
+ ### For OpenAI (Paid):
77
+
78
+ 1. Create an account at https://platform.openai.com/
79
+ 2. Navigate to API Keys section
80
+ 3. Create a new secret key
81
+ 4. Set the environment variable permanently:
82
+
83
+ ```powershell
84
+ [System.Environment]::SetEnvironmentVariable('OPENAI_API_KEY', 'your-key-here', 'User')
85
+ ```
86
+
87
+ ## Troubleshooting
88
+
89
+ **Command not found after installation:**
90
+
91
+ - Close and reopen your terminal
92
+ - Check that Bun is properly installed: `bun --version`
93
+
94
+ **LaTeX compilation fails:**
95
+
96
+ - Make sure you have a complete LaTeX distribution installed
97
+ - Ensure MiKTeX can install packages automatically
98
+
99
+ You're ready to use Jutge Toolkit on Windows!