A lightweight, frictionless browser extension designed to kill the repetitive busywork of saving code snippets, algorithmic solutions, and notes directly to GitHub.
Instead of juggling terminal commands, creating manual files, or wrestling with git commits, this extension allows you to highlight any code block on the web, click a button, and push it directly to your remote repository in seconds.
- 🧲 Auto-Capture Selected Text: Highlight code on any website (like LeetCode, ChatGPT, or documentation). When you open the extension, your highlighted text is automatically pulled into the editor.
- 🧠 Smart Auto-Save: Your Personal Access Token (PAT), target repository, and last-used file paths are saved locally. Set it up once and never type it again.
- 📝 Problem/Note Wrapping: Includes a dedicated input for problem descriptions or notes, which automatically wraps them into a clean multi-line comment block above your code.
- 🛡️ Collision Detection: Safely checks if a file already exists in your target path before pushing. If there's a conflict, it prompts you with a native UI to confirm if you want to cleanly overwrite it via SHA-matching.
- ⚡ Direct to Main: Leverages the GitHub v3 REST API to push files directly to your default branch. No intermediate branches, no unnecessary pull requests.
Since this is a custom local tool, it is installed directly via your browser's extension engine:
- Clone or Download this repository to your local machine.
- Open your Chromium-based browser (Chrome, Brave, Edge) and navigate to
chrome://extensions/. - Toggle on Developer mode in the top right corner.
- Click Load unpacked in the top left menu.
- Select the folder containing these extension files.
- Optional but recommended: Pin the extension to your browser toolbar for quick access.
To allow the extension to push code on your behalf, you need a one-time setup token.
- Go to your GitHub Settings -> Developer settings -> Personal access tokens -> Tokens (classic).
- Click Generate new token (classic).
- Give it a name and check the box for
repo(Full control of private repositories). - Generate and copy the token.
- Highlight a block of code on any webpage.
- Click the extension icon.
- Token: Paste your
ghp_...token. - Target Repository: Format as
username/repository-name(e.g.,dhruuvv-git/leetcode-solutions). - File Path: Define your path and extension (e.g.,
arrays/TwoSum.java). If the folders don't exist, the API will create them automatically. - Hit Upload Directly to Main.
Your token never leaves your machine. This extension relies purely on client-side JavaScript. Your GitHub Personal Access Token (PAT) is stored exclusively in your browser's local chrome.storage API. There are no external databases, telemetry, or third-party servers acting as middlemen. The extension communicates directly with the official api.github.com endpoints.
- HTML5 / CSS3: Clean, native-feeling popup UI.
- Vanilla JavaScript (ES6+): Async/Await API orchestration and background scripting.
- GitHub REST API (v3): Repository interactions, SHA fetching, and Base64 content uploading.
- Chrome Extension API:
chrome.storage,chrome.tabs,chrome.scripting.