Codeforces Tool is a command-line interface tool for Codeforces.
It's written in golang (without any browser driver). And it's fast, small(only about 6 MB), cross-platform and powerful.
You can find the source and binary files in my git repo https://github.com/xalanq/cf-tool
You can download the tool from release page https://github.com/xalanq/cf-tool/releases
- Support all programming languages in Codeforces.
- Support contests and gym in Codeforces.
- Submit codes.
- Watch submissions' status dynamically.
- Fetch problems' samples.
- Build, test and run.
- Clone all codes of someone.
- Generate codes from the specified template (including timestamp, author, etc.)
- List problems' stats.
- Use default web browser to open problems' pages, standings' page, etc.
- Colorful CLI.
I have tested the tool for contest Codeforces Round #551 (Div. 2).
It's not a cheating tool, but a tool for beautiful life :)
Pull requests are always welcome.
Examples: cf config Configure the cf-tool. cf submit If current path is "<contest-id>/<problem-id>", cf will find the code which can be submitted. Then submit to <contest-id> <problem-id>. cf submit a.cpp cf submit 100 a cf submit 100 a a.cpp cf list List all problems' stats of a contest. cf list 1119 cf parse 100 Fetch all problems' samples of contest 100 into "./100/<problem-id>". cf parse 100 a Fetch samples of problem "a" of contest 100 into "./100/a". cf parse Fetch samples of current problem into current path. cf gen Generate a code from default template. cf gen cpp Generate a code from the template whose alias is "cpp" into current path. cf test Run the commands of a template in current path. Then test all samples. If you want to add a new testcase, create two files "inK.txt" and "ansK.txt" where K is a string with 0~9. cf watch Watch the first 10 submissions of current contest. cf watch all Watch all submissions of current contest. cf open 1136 a Use default web browser to open the page of contest 1136, problem a. cf open 1136 Use default web browser to open the page of contest 1136. cf stand Use default web browser to open the standing page. cf sid 52531875 Use default web browser to open the submission 52531875's page. cf sid Open the last submission's page. cf race 1136 If the contest 1136 has not started yet, it will countdown. When the countdown ends, it will open all problems' pages and parse samples. cf pull 100 Pull all problems' latest codes of contest 100 into "./100/<problem-id>". cf pull 100 a Pull the latest code of problem "a" of contest 100 into "./100/<problem-id>". cf pull ac 100 a Pull the "Accepted" or "Pretests passed" code of problem "a" of contest 100. cf pull Pull the latest code of current problem into current path. cf clone xalanq Clone all codes of xalanq. cf upgrade Upgrade the "cf" to the latest version from GitHub.
You should run
cf config to configure your username, password and template at first.
Let's simulate a competition.
cf race 1136
To start competing the contest 1136! The id 1136 can be found in the contest URL.
If the contest has not started yet,
cf will count down. If the contest have started or the countdown ends,
cf will use the default browser to open all problems' page and fetch all samples to the local.
Enter the directory of problem A, the directory should contain all samples of the problem.
Generate a code with the default template. The filename of the code is problem id by default.
Use Vim to write the code (It depends on yourself).
Compile and test all samples.
Submit the code.
List problems' stats of the contest.
Open the standings' page of the contest.
I double click the program but it doesn't work
Codeforces Tool is a command-line tool. You should run it in terminal.
I cannot use
You should put the
cf program to a path (e.g.
/usr/bin/ in Linux) which has been added to system environment variable PATH.
Or just google "how to add a path to system environment variable PATH".
How to add a new testcase
Create two extra testcase files
ansK.txt (K is a string with 0~9).
Enable tab completion in terminal
Use this Infinidat/infi.docopt_completion.
Note: If there is a new version released (especially a new command added), you should run
docopt-completion cf again.