LeetCommit

Push accepted LeetCode solutions to GitHub.

Install from the Chrome Web Store


Overview

When LeetCode marks a submission Accepted, LeetCommit opens a modal so you can add notes and Big-O, then commits the solution to a repository you choose.

LeetCommit push modal after an Accepted submission

Wrong answers never trigger a push. The code that lands in your repo is the exact submission LeetCode judged.


Repository layout

Solutions are organized by difficulty and problem number. Resubmits write a new version instead of overwriting.

Example GitHub repository structure created by LeetCommit

Each problem folder keeps a notes.md with dated entries (newest first), including time and space complexity when you provide them.


How it works

  1. Connect GitHub once via device flow and grant the app access to a single repository.
  2. On leetcode.com, LeetCommit watches LeetCode’s submit and check network calls.
  3. Only an Accepted result (status_code === 10) opens the push modal.
  4. The extension commits the solution file and updates notes.md through the GitHub Contents API.

If you skip a push, the toolbar popup keeps the submission pending until you push or discard it.


Install

Chrome Web Store

  1. Install LeetCommit.
  2. Open the toolbar popup.
  3. Connect GitHub, then select a repository.

From source

  1. Clone this repository.
  2. Open chrome://extensions, enable Developer mode, and choose Load unpacked.
  3. Select the project folder, then connect GitHub from the popup.

Tech stack

Layer Details
Extension Chrome Manifest V3, plain JavaScript, no build step
Detection MAIN-world network interception on LeetCode submit/check
UI Isolated-world content script modal
Auth GitHub App device flow, with token refresh
API GitHub Contents API via a background service worker

Privacy

LeetCommit runs locally in your browser. Your code and GitHub token are sent only to GitHub’s API for the repository you authorize. See PRIVACY.md for the full policy.


License

MIT