CLI for running code using HackerRank API.
Run the following command
$ npm install -g hackerrank-cli
You can get your HackerRank API Key by visiting HackerRank API page.
$ hackerrank <command>
Commands:
run Run code on HackerRank server
config Change config file
Options:
-h, --help Show help [boolean]
$ hackerrank run <options>
Options:
-h, --help Show help [boolean]
-s, --source Source Code file path [required]
-i, --input Input file path [required]
-l, --language Language. Change `config` for default.
-o, --output Output file path [required]
Examples:
hackerrank run -s A.cpp -i Input00.in -o Output.txt -l 2
Run $ sudo hackerrank config
to change configuration of your installation. This includes default language and API Key.
$ sudo hackerrank config <options>
Options:
-h, --help Show help [boolean]
-l, --list List language and their code [boolean]
Examples:
sudo hackerrank config -l
Run:
$ git clone https://github.com/manrajgrover/HackerRank-CLI.git
$ cd HackerRank-CLI
$ npm link
This will setup a symbolic link to the CLI. Any changes in source files will now be reflected when running the hackerrank
command.
To lint your code, run
$ npm run lint