Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coding-agent

Auto-solve coding challenges. 2/day. Free tier. Groq LLM + Playwright browser.

Platforms

LeetCode · Codeforces · HackerRank · CodeChef

Setup

python -m venv .venv
.venv\Scripts\activate      # win
pip install -r requirements.txt
python -m playwright install chromium
cp .env.example .env        # fill GROQ_API_KEY

Google Chrome must be installed on the system — the agent runs and captures cookies through it (bypasses the automation detection that blocks bundled Chromium).

First-time login (cookie capture)

python -m src.login leetcode
python -m src.login codeforces
python -m src.login hackerrank
python -m src.login codechef

Two-tier strategy:

  1. Fast pathbrowser-cookie3 reads Chrome's SQLite cookie store directly. Works on older Chrome and if you've disabled App-Bound Encryption.
  2. Fallback — Chrome 127+ (mid-2024 onwards) uses App-Bound Encryption; browser-cookie3 fails with Unable to get key for cookie decryption. The script automatically falls back to launching a dedicated Chrome instance at .chrome-profile/ via --remote-debugging-port and grabs cookies over CDP after you log in. You only log in once per platform — the profile persists, so next time the browser opens already signed in and you just press Enter.

Tip: on the fallback path, use GitHub / Google OAuth on the login page to skip reCAPTCHA.

Force the fallback path directly:

python -m src.login leetcode --launch

Non-default Chrome profile for the fast path? set CHROME_PROFILE=Profile 1 before running.

Run

python -m src.main                          # dry-run, 2 random problems
python -m src.main --submit                 # drain pending dry-runs FIRST, then pick new
python -m src.main --submit-pending         # drain backlog only, no new picks
python -m src.main --platform leetcode      # force one platform (filters pending too)
python -m src.main --count 3

Submit-pending stack

Every dry-run row in logs/solutions.xlsx (Status = dry-run) is treated as a pending submission. On --submit, the backlog is drained LIFO — newest first before any fresh problem is picked. Each submitted row is updated in-place (Status → verdict, Runtime, Notes) rather than appended as a new row.

Output

  • solutions/<platform>/<date>_<id>.java — LLM solution
  • solutions/<platform>/<date>_<id>.java.meta.json — sidecar (url, title, difficulty, tags) used to replay pending submits without re-querying the platform
  • logs/solutions.xlsx — log with Date, Platform, Problem#, Title, Difficulty, Tags, Status, Language, Runtime, Notes
  • If Excel has the log open, appends fall back to logs/solutions_YYYYMMDD.xlsx

Notes

  • Language: Java (all platforms)
  • Session cookies only, no password stored
  • Dry-run = generate + save + log, no submit
  • Groq free tier: qwen3-32b good coder, fallback llama-3.3-70b-versatile

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages