Configuration
#
Creating Your First Configuration FileExecute the following command to create a configuration file:
This command will create a file called cpbooster-config.json
in your $HOME directory with default values.
If you wish to create your configuration file somewhere else you can specify the path using --configPath
flag
each time you run a command.
tip
By default cpbooster
looks for the configuration file in any of the following directories
$HOME/cpbooster-config.json
$HOME/.cpbooster/cpbooster-config.json
$HOME/.config/cpbooster/cpbooster-config.json
Take a look at this issue for context.
#
Configuration File Examplecpbooster-config.json
#
#
Fields DescriptioncontestsDirectory: string
#
The path to the directory where contests folders will be created when you run cpb clone
.
The directory of a user that has cloned 3 contests would look like this:
port: number
#
Specifies the port where competitive companion extension will send problem's data.
1327 is the default port for cpbooster
in competitive companion so, if you don't change
the port, it will just work as expected. If you must change it, then be sure that you also
change it in competitive companion extension settings.
editor: string
#
Name of the editor that will be opened after running cpb clone
.
The editor value should match with the terminal command you use to launch it. See Editor Requirements
note
An editor can be a terminal emulator also.
#
Editor Requirements- You must be able to open your editor using a terminal command.
- If the editor is a terminal emulator it should be in the list of supported terminals.
- If the editor is NOT a terminal emulator. The editor command should support the following format to open a directory:
If your editor does not support this format but has another way to open a directory, you could take a look at "How to add an editor"
#
Examples- Using regular editor ( VSCode ):
since code
is the command that is used to execute vscode from the terminal.
- Using terminal emulator ( konsole ):
note
Terminal Emulator support is currently limited to this List of supported terminals. Visit the section "How to add an editor" if you wish to contribute and add support for other terminal emulators.
#
List of supported terminals"konsole"
"xterm"
"gnome-terminal"
"deepin-terminal"
"kitty"
"alacritty"
"terminal"
(MacOS)
closeAfterClone: boolean
#
Whether to close the terminal after the execution of cpb clone
or not.
caution
When using this option as true
verify that your editor satisfies the Editor Requirements, otherwise,
you might end up with your terminal closed and no editor opened.
showStatusPageOnSubmit: boolean
#
Whether to open a browser window in the submission status page or not, after running cpb submit
useUserDefaultBrowser: boolean
#
Whether to open the status page using default browser or the one bundled with cpbooster
.
See Submit Requirements
preferredLang: string
#
The extension name in lowercase of your preferred language. ( i.e. "cpp"
, "py"
, "java"
, ... ),
cpb clone
uses this value to create corresponding source files with the template of your
preferred language.
important
This value must match exactly (case-sensitive) with the extension used in the source files.
hideTestCaseInput: boolean
#
Whether or not to show the test case input when testing
cloneInCurrentDir: boolean
#
When true it clones contests or single problems in current directory instead of the global contest directory.
languages: Record<LangExtension, LangConfig>
#
In languages
you can configure the settings of each programming language.
note
cpbooster
officially supports the following languages:
c
c++
rust
go
python
javascript
ruby
java
kotlin
scala
officially supporting these languages means that they were tested exhaustively, however,
other languages might be supported as well due to the generality of the algorithm used to parse the commands
to compile or run. In case cpbooster
can't work correctly with the language you wish to use,
visit the section "How to add a language" which will guide you on how to contribute
to the project.
important
The keys (<lang>
) must match exactly (case-sensitive) with the extension used in the source files.
i.e. if you use cpp
extension for your c++
programs then you must use cpp
as key
of the json object, CPP
won't work, neither Cpp
nor cPP
, ... and the same applies
for the languages
languages.<lang>.template: string
#
Path to your competitive programming template for the corresponding <lang>
.
Here are some examples of competitive programming templates (if you wish, you can download them and use them):
- CompetitiveProgrammingTemplate.cpp
- This template allows you to print anything like in python with a
debug
function that just works whendebugCommand
is used. See Debug section.
- This template allows you to print anything like in python with a
- CompetitiveProgrammingTemplate.py
- This template includes Fast IO operations for python
languages.<lang>.command: string
#
The command that will be used to compile
(compiled
or mixed
languages)
or run (interpreted
languages) your program for testing purposes.
For example: If you use codeforces it is convenient that you use the same command they use for each language
tip
If you specify the name of the executable file in this command, it will be used instead of the default name (same as source file). See Test section.
Example: In C++
you can use the -o
flag to specify the name of the executable file that will be created after compilation.
languages.<lang>.debugCommand: string
#
The command that will be used to compile
(compiled
or mixed
languages) or run
(interpreted
languages) your program for debugging purposes.
Usually debugCommand
has more flags than command
.
Some debug command examples for cpp
and py
:
tip
You can specify the name of the executable file in the same way you would do it
in languages.<lang>.command
.
Visit the Debug section to see usage examples of this feature.
languages.<lang>.runCommand: string
#
The command that will be used to run mixed
type languages like (java, kotlin, scala, ...).
note
This type of languages are compiled with some command (i.e. javac, kotlinc, scalac, ...) but they get run with a different one (java, kotlin, scala, ...)
languages.<lang>.aliases: Object<OnlineJudgeName, string>
#
Language "aliases" for each OnlineJudge. See How To Configure Language Aliases.
For example: the alias for C++
in Codeforces and AtCoder is "54"
and "4006"
respectively
languages.<lang>.type: "compiled" | "interpreted" | "mixed"
#
Specifies whether the language is "compiled"
(C++
, go
, rust
, C#
),
"interpreted"
(python
, javascript
, ruby
, ...) or "mixed"
(java
, kotlin
, scala
, ...).
cpbooster
is aware that some languages can be interpreted
as well as compiled
,
like python
which can be compiled with nuitka or javascript
which
can be compiled with nectarjs.
With this option you have the chance to tell cpbooster
how to work with
the language you provide. For a definition of mixed
languages, See Mixed Languages
note
In case this option is not provided, then cpbooster
will try to infer the type
depending on the language. But consider that cpbooster
is not aware of all the languages
it actually support, specifying this option reduces the risk of unexpected errors.
See Languages Support
languages.<lang>.commentString: string
#
Tells cpbooster
which comment string to use depending on the language.
cpbooster
uses a generic algorithm to support a great variety of languages,
some of them are know by cpbooster
but some others are unknown for it,
therefore cpbooster
might not know how to write comments in that language.
note
Comments are used to write information in the source code file such as:
- time-limit
- problem-url