joglr / katpis

Kattis CLI implemented using C#
3 stars 1 forks source link

Katpis - A Kattis CLI

Katpis is a command-line interface for kattis.com

Katpis allow you to fetch sample files, test your program, and submit your solution, all within your favorite commmand-line.

It is inspired by the official, but barebones CLI at github.com/Kattis/kattis-cli

katpis submit

Installation

Windows

Currently, we don't automatically build installers, so for now installation steps are as follows:

  1. Install .NET Core SDK

  2. Clone this repository

  3. Add the root of this repository to your path enviroment variables - e.g. C:\Users\myuser\somefolder\katpis

Now you can run the command katpis anywhere!

Mac/Linux

We will provide installation instructions for these platforms in the near future. You might be able to get it to work using the instructions for Windows.

Available commands

katpis submit

Submits a .java file from the current directory to Kattis with a matching name to a Kattis problem shortname.

Usage

katpis submit <filename-with-extension>

Example

katpis submit Hello.java

katpis test

Tests any matching .in and .ans files on any .java problem in the current directory.

Usage

katpis test

katpis fetch

Fetches any available sample files, given the shortname of any Kattis problem.

Usage

katpis fetch <kattis-problem-shortname>

Example

For the problem "Quality-Adjusted Life-Year" at open.kattis.com/problems/qaly, run

katpis fetch qaly

You should now see the newly downloaded files in your current directory, if any sample files were available.

katpis template

Generates a new file from a template with basic input parsing.

Usage

katpis template <filename-with-extension>

Example

katpis template Hello.java

The above command will generate a .java file to the current directory.

Development

Useful commands

To run katpis using .NET Core SDK, the following command can be used:

dotnet run [args]

You can pass any arguments, e.g. sub command and its arguments, after dotnet run

To rebuild and restart the program, every time the source code changes, use the following command:

dotnet watch run [args]