A simple JavaScript script/extension that adds an "Open in VSCode" button
to GitHub repository pages. This allows users to open and clone the repository directly
into their Visual Studio Code editor with a single click.
- Automatically injects an "Open in VSCode" button into GitHub repository pages.
- Allows users to open and clone the selected repository directly in Visual Studio Code.
- Works seamlessly with GitHub's dynamic page loading (PJAX navigation).
- Lightweight and easy to integrate into any browser as an extension or directly as a user script.
- Supports GitHub's standard repo pages and private repositories (as long as the user is authenticated).
The easiest way to install this functionality is by using the browser extension. You can install the extension directly into Chrome or other Chromium-based browsers.
- Clone this repository:
git clone https://github.com/psparwez/open-in-vsode.git
- Load the extension into your browser:
- Open Chrome (or any Chromium-based browser like Edge).
- Go to
chrome://extensions/
in the address bar. - Enable Developer Mode in the top right.
- Click on Load unpacked and select the directory of the cloned repo.
- Verify the installation:
- Navigate to any GitHub repository page (e.g.,
https://github.com/{username}/{repo-name}
). - You should now see the "Open in VSCode" button appear on the repository page.
- Click the button to open the repository directly in Visual Studio Code.
- This extension works only if Visual Studio Code is installed on your system.
- Ensure you have authentication set up in VS Code for private repositories.
If you prefer not to install the browser extension, you can use this script directly with a userscript manager like Tampermonkey or Greasemonkey.
- Install a userscript manager:
- Create a new userscript:
- Open the userscript manager and create a new script.
- Copy and paste the
content.js
code from this repository into the script editor.
- Save and Activate the Script:
- Save the script and refresh any GitHub repository page.
- The "Open in VSCode" button should appear on the page.
Feel free to fork this repository, improve the script, or add new features. Pull requests are welcome! 🚀
To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
Please follow the style and formatting of the existing code. If you're adding a new feature, make sure to update the documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues, bugs, or have suggestions for improvements, please open an issue on GitHub. We value your feedback and will try to address it as soon as possible.