The URIOnlineJudge command line utility.
Last updated 2 years ago by matheussampaio .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install urionlinejudge-cli -g
SYNC missed versions from official npm registry.

npm version Build Status Dependency Status devDependency Status

URI Online Judge - CLI

The URI Online Judge command line utility makes it easy to submit problems, wait for the solution and fetch new problems via command line!

What is a command line utility?

A command line utility is one to be used from a shell (or commonly known as a Terminal). It receives input from this shell, and reports its output in the same shell.


$ npm install -g urionlinejudge-cli

Note: For a global install of -g urionlinejudge-cli, OSX/Linux users may need to prefix the command with sudo or can setup proper file permissions on OSX for npm to install without sudo.


submit <filepath> [number]

You can submit a problem solution to the URI Online Judge.


Option Default Description
--language [language] python Language used for submitting. Pick one: [c, c++, c#, java, python, python3, ruby].


$ urionlinejudge submit ./1001.py
# or
$ urionlinejudge submit ./file.py 1001
# or
$ urionlinejudge submit ./file.cpp 1001 --language c++


You can fetch a problem description from the URI Online Judge and populate a template file with that description.

You have to add urionlinejudge::description to your template.

Option Default Description
-n, --number [number] required Problem number.
-t, --template [path] Use config.template value Template filepath.
-o, --output [path] . File output path.
-f, --force Force overwrite existing files.


You create one template and add // urionlinejudge::description at any place:

#include <iostream>

using namespace std;

// urionlinejudge::description

int main()
    // work here

    return 0;

Then you execute the fetch command passing your template path:

# get template path from configs
$ urionlinejudge fetch -n 1001
# overwrite the template path
$ urionlinejudge fetch -n 1001 -t ../templates/template.cpp
# overwrite existing files
$ urionlinejudge fetch -n 1001 -t ../templates/template.cpp -f
# save file at ../solutions/folder
$ urionlinejudge fetch -n 1001 -t ../templates/template.cpp -o ../solutions/folder

Then the CLI will fetch the problem description and create this file for you:

#include <iostream>

using namespace std;

 * Title:
 * Extremely Basic
 * Timelimit: 1
 * Description:
 * Read 2 variables, named A and B and make the sum of these two variables,
 * assigning its result to the variable X. Print X as shown below. Print
 * endline after the result otherwise you will get “Presentation Error”.
 * Input:
 * The input file will contain 2 integer numbers.
 * Output:
 * Print X according to the following example, with a blank space before and
 * after the equal signal.

 int main()
     // work here

     return 0;


You can reset your information.


$ urionlinejudge reset
What is the full path for the template? ../uri/template.cpp
What is your email? matheus1401@gmail.com
What is your password? *******

[*] Success:
[*] Email: matheus1401@gmail.com
[*] Template: /Users/user/git/uri/template.cpp

Developing and Contributing

We'd love to get contributions from you! For a quick guide to getting your system setup for developing take a look at our Quickstart Guide. Once you are up and running, take a look at the Contribution Documents to see how to get your changes merged in.


See LICENSE file.

Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (10)
Dev Dependencies (19)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |