Skip to content
/ gitbolt Public

A Chrome extension to capture and commit code from Compiler Explorer (godbold.org) to GitHub.

License

Notifications You must be signed in to change notification settings

vvrs/gitbolt

Repository files navigation

GitBolt: Compiler Explorer to GitHub

GitBolt is a Chrome extension that allows you to commit code directly from Compiler Explorer (Godbolt.org) to your GitHub repositories. It captures your code, generates a short link, and pushes it to a repository of your choice with a single click.

GitBolt Banner

Features

  • Seamless Integration: Works directly within the Godbolt.org interface.
  • GitHub Authentication: Securely authenticate using a Personal Access Token (PAT) with a user-friendly welcome flow.
  • Repository Selection: Choose any of your GitHub repositories to save your code.
  • Smart Commits:
    • Auto-generates filenames with timestamps or lets you specify a custom name.
    • Updates existing files if the filename matches.
    • Includes a Godbolt short link in the commit for easy reference.
  • Privacy Focused: Your token is stored locally in your browser and never sent to any third-party server.

Screenshots

1. Authentication

Authentication Flow

2. Committing Code

Commit Popup

Installation

From Chrome Web Store

(Coming Soon)

Manual Installation (Developer Mode)

  1. Clone this repository:
    git clone https://github.com/yourusername/gitbolt.git
  2. Open Chrome and navigate to chrome://extensions.
  3. Enable Developer mode in the top right corner.
  4. Click Load unpacked.
  5. Select the gitbolt directory from the cloned repository.

Usage

  1. Authenticate: Click the extension icon. If it's your first time, follow the "Welcome" flow to generate and save your GitHub Personal Access Token.
  2. Write Code: Go to godbolt.org and write your C++, Rust, Go, or Python code.
  3. Commit:
    • Click the GitBolt icon.
    • Select a target Repository.
    • (Optional) Enter a Filename (e.g., solution.cpp).
    • Enter a Commit Message.
    • Click Submit.
  4. Done!: Your code is now on GitHub with a link back to the Compiler Explorer session.

Development

Build

To create a zip file for distribution:

./build.sh

Project Structure

  • manifest.json: Extension configuration (Manifest V3).
  • popup.html / popup.js: The main extension interface.
  • content.js: Script that runs on Godbolt.org to extract code and links.
  • background.js: Service worker for handling installation events.
  • welcome.html / welcome.js: Onboarding flow.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

About

A Chrome extension to capture and commit code from Compiler Explorer (godbold.org) to GitHub.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published