Codeforces Tool is a command-line interface tool for Codeforces.
It's fast, small, cross-platform and powerful.
Installation | Usage | FAQ | 中文
- Support all programming languages in Codeforces.
- Support contests and gym.
- Submit codes.
- Watch submissions' status dynamically.
- Fetch problems' samples.
- Compile and test locally.
- Clone all codes of someone.
- Generate codes from the specified template (including timestamp, author, etc.)
- List problems' stats of one contest/gym.
- Use default web browser to open problems' pages, standings' page, etc.
- Colorful CLI.
Pull requests are always welcome.
You can download the pre-compiled binary file in here.
Or you can compile it from the source (go >= 1.12):
$ git clone https://github.com/xalanq/cf-tool
$ cd cf-tool
$ go build -ldflags "-s -w" cf.go
Let's simulate a competition.
cf race 1136
To start competing the contest 1136! The id 1136 can be found in the contest URL.
e.g. https://codeforces.com/contest/1136
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 dashboard's page and problems' page, and fetch all samples to the local.
cd 1136/a
Enter the directory of problem A, the directory should contain all samples of the problem.
cf gen
Generate a code with the default template. The filename of the code is problem id by default.
vim a.cpp
Use Vim to write the code (It depends on yourself).
cf test
Compile and test all samples.
cf submit
Submit the code.
cf list
List problems' stats of the contest.
cf stand
Open the standings' page of the contest.
Download handles list
cf handles
The placeholders inside the template will be replaced with the corresponding content when you run cf gen
.
$%U%$ Username
$%Y%$ Year (e.g. 2019)
$%M%$ Month (e.g. 04)
$%D%$ Day (e.g. 09)
$%h%$ Hour (e.g. 08)
$%m%$ Minute (e.g. 05)
$%s%$ Second (e.g. 00)
/* Generated by powerful Codeforces Tool
* You can download the binary file in here https://github.com/xalanq/cf-tool (win, osx, linux)
* Author: $%U%$
* Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
return 0;
}
Codeforces Tool is a command-line tool. You should run it in terminal.
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".
Create two extra testcase files inK.txt
and ansK.txt
(K is a string with 0~9).
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.