A CLI for all your CodinGame needs
$ npm install -g @snowfrog/cg-cli
$ cg COMMAND
running command...
$ cg (-v|--version|version)
@snowfrog/cg-cli/0.9.1 win32-x64 node-v14.16.1
$ cg --help [COMMAND]
USAGE
$ cg COMMAND
...
display autocomplete installation instructions
USAGE
$ cg autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ cg autocomplete
$ cg autocomplete bash
$ cg autocomplete zsh
$ cg autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
bundle your source code into one file that can be submitted to CodinGame
USAGE
$ cg bundle
OPTIONS
-c, --code=code
path to the file containing the code to be submitted to CodinGame
-h, --help
show CLI help
-l,
--language=Bash|C|C#|C++|Clojure|D|Dart|F#|Go|Groovy|Haskell|Java|Javascript|Kotlin|Lua|ObjectiveC|OCaml|Pascal|Perl|P
HP|Python3|Ruby|Rust|Scala|Swift|TypeScript|VB.NET
programming language of your bot source code
-s, --source=source
path to folder containing the source code to be bundled
--config=config
[default: ./cgconfig.json] path to config file
See code: src/commands/bundle.ts
display help for cg
USAGE
$ cg help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
initializes a CodinGame project by adding a cgconfig.json file
USAGE
$ cg init
OPTIONS
-h, --help show CLI help
See code: src/commands/init.ts
play test session playouts between two bots
USAGE
$ cg play [COUNT]
ARGUMENTS
COUNT [default: 1] the number of games to play on the server. Must be bigger than 0
OPTIONS
-c, --code=code
path to the file containing the code to be submitted to CodinGame
-h, --help
show CLI help
-i, --interactive
interactive menu to choose opponent(s) to agent 1
-l,
--language=Bash|C|C#|C++|Clojure|D|Dart|F#|Go|Groovy|Haskell|Java|Javascript|Kotlin|Lua|ObjectiveC|OCaml|Pascal|Perl|P
HP|Python3|Ruby|Rust|Scala|Swift|TypeScript|VB.NET
programming language of your bot source code
-o, --output
whether or not to output simulation data to file
-p, --puzzle=puzzle
name of puzzle or contest used by CodinGame API
-r, --replay
use the same game conditions as the last game.
--agent1=agent1
id of agent 1, a value of -1 means your own code, a value of -2 means the boss for the league
--agent2=agent2
id of agent 2, a value of -1 means your own code, a value of -2 means the boss for the league
--config=config
[default: ./cgconfig.json] path to config file
--outdir=outdir
directory in which to place the output data from simulation playthroughs, created if doesn't exist
--top10
play agent1 against the top 10 bots in the league
EXAMPLE
$ cg play 10 -o
Reading config file... done
Validating inputs... done
Fetching test session id from CodinGame... done
Grabbing source code... done
Playing games...
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ETA: 0s | 10/10 | Agent1: 5 wins (50%) | Agent2: 5 wins (50%) | Margin of
Error: 32%
Writing game data... done
See code: src/commands/play.ts