Project

codechef-cli

A command-line tool for querying and submitting problems on CodeChef - without ever touching a browser.

36 stars · 36 forks Python · 100% Open source · GPL-3.0
Python CLI CodeChef Competitive Programming Web Scraping

During my competitive programming days, the context-switching was the most annoying part. You read a problem in the browser, jump to your editor to write the solution, then switch back to upload and submit - over and over. It added friction to a workflow that should have been purely about thinking and coding.

So I built codechef-cli, a Python command-line tool that brings CodeChef into your terminal. With a single pip install codechefcli, you can log in, fetch problem descriptions, browse contests, search users and ratings, and submit solutions - all without touching a browser.

# install
pip install codechefcli

# read a problem
codechefcli --problem WEICOM

# submit your solution
codechefcli --submit WEICOM solution.cpp C++

The project taught me a lot about building developer tools the right way. A CLI lives or dies by its interface - flags need to be intuitive, output needs to be scannable, and errors need to be honest. Getting that right took more iteration than the underlying scraping logic.

I also learned how fragile web scraping can be. CodeChef's HTML structure was the source of truth, and every site update was a potential breakage. That pushed me to write proper tests early and take code quality seriously - linting with flake8, import ordering with isort, and keeping test coverage meaningful rather than cosmetic. It shifted my mindset from treating it as a weekend script to owning it like a real software product.

The repo picked up 36 stars and 36 forks organically, which told me the friction I felt was shared by others. If you spend time on competitive platforms, your tools should get out of your way. Sometimes the best way to fix that is to build the tool yourself.