Installation
You can install cpg using cargo:
# NOTE: Only prereleases are available at this time.
# Build from source
cargo install "competitive-programming-cli@>0.1.0-preview.0"
# Or download the pre-built binaries using cargo-binstall
cargo binstall "competitive-programming-cli@>0.1.0-preview.0"
The release workflow builds the following archives, each with a SHA-256 checksum, for the releases page.
You can install those binaries manually or using package managers like mise.
# Using mise
mise use -g github:sevenc-nanashi/competitive-programming-cli
Experimental oj backend
For judges without a native backend, install uv and make it available on PATH.
On first use, cpg runs uv venv and installs its pinned fork of online-judge-api-client.
See experimental oj support for usage, virtual environment paths, and limitations.
Shell completion
cpg completion <shell> prints a completion script generated from cpg's command
definitions. It completes commands, aliases, flags, value choices, and file or
directory paths.
For Bash, add this to ~/.bashrc:
source <(cpg completion bash)
For Zsh, add this to ~/.zshrc after enabling completion:
autoload -Uz compinit
compinit
source <(cpg completion zsh)
For Fish, save the script in its completion directory:
mkdir -p ~/.config/fish/completions
cpg completion fish > ~/.config/fish/completions/cpg.fish
elvish, nu (Nushell), and powershell are also supported. Save their generated
scripts and load them from your shell configuration. Reopen the shell or source
its configuration to enable completion.