demo1.mp4
Inspired by CF-Tool
This command-line tool exposes a lightweight server that receives problem definitions from the Competitive Companion browser extension and prepares local workspaces for solving, testing, and submitting solutions.
- Install the Competitive Companion extension in your browser and enable “custom test case receiver” pointing to your CCS port.
- Install
cph-submit
and ensure it is on yourPATH
so thesubmit
subcommand can forward submissions.
CCS reads config.json
at startup. By default it searches:
- Linux:
$XDG_CONFIG_HOME/ccs/config.json
then~/.config/ccs/config.json
- macOS:
~/Library/Application Support/ccs/config.json
- Windows:
%APPDATA%\ccs\config.json
- Current working directory:
./config.json
Use --config /path/to/config.json
to override the location when launching any command.
Run ccs config
to generate a starter configuration or add language templates through an interactive prompt.
Example configuration:
{
"workspace": "/home/ralph/ICPC",
"template": [
{
"alias": "cpp",
"lang": "89",
"path": "/home/ralph/Templates/sol.cpp",
"suffix": ["cpp", "cc"],
"before_script": "g++ $%full%$ -o $%file%$.exe -O2 -std=c++20",
"script": "./$%file%$.exe",
"after_script": "rm $%file%$.exe"
},
{
"alias": "py",
"lang": 70,
"path": "/home/ralph/Templates/io.py",
"suffix": ["py"],
"before_script": "",
"script": "python $%full%$",
"after_script": ""
}
],
"default": 0,
"gen_after_parse": true
}
workspace
selects where problems and samples are stored.template
entries describe each language:alias
, Codeforceslang
id, template path, file suffixes, and optionalbefore_script
/script
/after_script
commands. Placeholders%path%
,%file%
,%full%
(optionally wrapped as$%...%$
) are substituted before execution.default
picks the template that auto-generates whengen_after_parse
istrue
.gen_after_parse
controls whether the daemon runsccs gen <default alias>
automatically after new test data arrives.
Problems are created beneath the configured workspace. CCS derives nested folders from contest metadata (platform → contest → problem) and emits:
<workspace>/
<platform>/
<contest>/
<problem>/
in1.txt # sample input 1
ans1.txt # expected output 1
...
<alias>.ext # generated via config or `ccs gen`
Samples follow the in{n}.txt
/ ans{n}.txt
convention. Templates listed in config.json
can be copied on demand with ccs gen <alias>
or automatically when gen_after_parse
is enabled.
- Build or install the binary:
cargo install --path .
- Ensure your
config.json
is in place (see above). Override with--config
if you keep it elsewhere. - Start the daemon to receive problems:
The daemon writes samples into the configured workspace and optionally generates the default template.
ccs daemon --port 27121
- Generate additional templates on demand:
# copy the template with alias "py" into the current directory ccs gen py
- After Competitive Companion pushes a task, implement your solution and run:
# Test against stored samples (auto-detects matching files, or choose from a prompt when multiple match) ccs test # Submit via cph-submit (optionally specify a file path) ccs submit ./sol.cpp
Useful flags shared by all subcommands:
Flag | Description |
---|---|
--config <path> |
Override the location of config.json . |
--port <num> |
Listening port for the daemon (default 27121 ). |
--log-file <dst> |
stderr , stdout , or a file path for log output. |
--verbose |
Enable debug logging. |
--short-path |
Use condensed directory layout for compatible problem sources. |
CCS is actively developed; expect breaking changes and incomplete features while we iterate on submission flows and tooling.