A high-quality, professional CLI tool for interacting with Codeforces. Engineered for performance, maintainability, and extensibility.
- Secure Authentication: Safely stores your Codeforces credentials using system keyring.
- Smart Submission: Auto-detects contest ID, problem index, and language from your source file.
- Contest Management: View upcoming and recent contests in a rich table.
- Live Status: Check your recent submission verdicts with color-coded results.
- User Stats: View detailed user profiles, ratings, and ranks.
- Blogs: Keep up with the latest Codeforces blog entries and actions.
- Configuration: Customizable preferences (e.g., default language, headless browser).
# Clone the repository
git clone https://github.com/regular-life/Codeforces-CLI-Tool
cd Codeforces-CLI-Tool
# Set up a virtual environment (Recommended)
python3 -m venv .venv
source .venv/bin/activate
# Install the package in editable mode
pip install -e .The tool uses a subcommand structure: cftool [COMMAND] [OPTIONS].
Manage your login session securely.
# Login (Prompts for username/password)
cftool auth login
# Check current login status
cftool auth status
# Logout (Removes credentials from keyring)
cftool auth logoutList active and upcoming contests.
# List contests (Shows top 20 upcoming/recent)
cftool contest list
# List Gym contests
cftool contest list --gymSubmit solutions directly from your terminal.
Smart Detection:
- If you name your file
1234A.cpp, the tool automatically submits to Contest 1234, Problem A, using C++17 (detected from extension).
# Simple submission (Infers details from filename)
cftool submit solution 1234A.cpp
# Explicit submission (Overrides detection)
cftool submit solution Main.cpp --contest-id 1234 --problem-index A
# Force a specific language (e.g., Python 3)
cftool submit solution script.py --language 31Check recent verdicts.
# Show your recent submissions (requires login)
cftool status
# Show submissions for specific user (e.g., tourist)
cftool status --handle tourist --count 5View profile information.
# View your own stats
cftool user
# View another user's stats
cftool user --handle touristView recent activity on Codeforces.
# List recent blogs and comments
cftool blog --count 15Manage tool settings.
# Show current configuration
cftool config show
# Set a value (e.g., disable headless mode for debugging)
cftool config set headless_mode falseThis project is rebuilt as a modular Python package:
cftool/core: Backend business logic, API client, and Selenium automation.cftool/cli: Typer-based CLI presentation layer with Rich formatting.cftool/core/models.py: Pydantic data models for type safety.cftool/core/config.py: TOML-based configuration and Keyring integration.
MIT