Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Installation

Adithya Joshua Dsilva edited this page Nov 8, 2020 · 1 revision

Installation

📣 📣 The following installation instructions are for first time users only.

Existing users can upgrade the command line tool and the checkers with the following commands.

cpt upgrade -m s
cpt upgrade -m c

GitHub Releases

Download the tarball corresponding to your system from the latest release page. Extract the executable from the archive, and follow the instructions below, corresponding to your OS.

Linux

  1. Move the executable to /home/<username>/.local/bin directory (create the folder if not exists).
  2. To add the directory to the system path, follow the instructions given here (zsh users might need to use .zshrc instead of .bashrc).

Windows

Note: WSL users must follow the Linux installation instructions specified above.

  1. Move the executable to C:\Program Files\ directory.
  2. Add C:\Program Files\ to the path if not present.

MacOS

  1. Move the executable to /usr/local/bin directory.
  2. To add the directory to the system path, follow the instructions given here (zsh users might need to use .zshrc instead of .bashrc).

Run cpt --help in the terminal. If installed correctly, the following help menu will appear.

Lightweight cli tool for competitive programming!

Usage:
  cpt [command]

Available Commands:
  codeforces  Functions exclusive to codeforces
  config      Configure global settings
  generate    Create file using template
  help        Help about any command
  test        Run code file against sample tests
  upgrade     Upgrade cli to latest version

Flags:
  -h, --help      help for cpt
  -v, --version   version for cpt

Use "cpt [command] --help" for more information about a command.

Source Build

To build from source, run the following commands.

git clone https://github.com/cp-tools/cpt.git
cd cpt/
go build -ldflags "-s -w"

The compiled executable will be present in the root project directory. Follow the above instructions to add the executable to system path, to run it from any directory.

Clone this wiki locally