Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

cf-tool

> 数据库
Open source

:bar_chart: Codeforces CLI (Submit, Parse, Test, etc.). Support Contests, Gym, Groups, acmsguru, Windows, macOS, Linux, 7 MB

1.4K stars0 likes2 views
WebsiteGitHub

About

:bar_chart: Codeforces CLI (Submit, Parse, Test, etc.). Support Contests, Gym, Groups, acmsguru, Windows, macOS, Linux, 7 MB

Codeforces Tool

Codeforces Tool is a command-line interface tool for Codeforces.

It's fast, small, cross-platform and powerful.

Installation | Usage | FAQ | 中文

Features

  • Support Contests, Gym, Groups and acmsguru.
  • Support all programming languages in Codeforces.
  • 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.
  • Use default web browser to open problems' pages, standings' page, etc.
  • Setup a network proxy. Setup a mirror host.
  • Colorful CLI.

Pull requests are always welcome.

Installation

You can download the pre-compiled binary file in here.

Then enjoy the cf-tool~

Or you can compile it from the source (go >= 1.12):

plain
$ go get github.com/xalanq/cf-tool
$ cd $GOPATH/src/github.com/xalanq/cf-tool
$ go build -ldflags "-s -w" cf.go

If you don't know what's the $GOPATH, please see here https://github.com/golang/go/wiki/GOPATH.

Usage

Let's simulate a competition.

cf race 1136 or cf race https://codeforces.com/contest/1136

To start competing the 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 ./cf/contest/1136/a (May be different from this, please notice the message on your screen)

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.

…

Template Example

The placeholders inside the template will be replaced with the corresponding content when you run cf gen.

$%U%$   Handle (e.g. xalanq)
$%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)
cpp
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (Windows, macOS, 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;
}

FAQ

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 cf command

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 inK.txt and 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.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goclicodeforcescross-platformgolang

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库