{"id":30351200,"url":"https://github.com/vblinden/open-in-browser","last_synced_at":"2026-01-20T16:58:19.916Z","repository":{"id":308864222,"uuid":"1028851476","full_name":"vblinden/open-in-browser","owner":"vblinden","description":"Open files or selected code lines from your Git repository directly in the browser from within VSCode","archived":false,"fork":false,"pushed_at":"2025-08-08T09:39:45.000Z","size":1019,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T00:27:49.589Z","etag":null,"topics":["git","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vblinden.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-30T06:47:23.000Z","updated_at":"2025-08-08T09:39:47.000Z","dependencies_parsed_at":"2025-08-08T11:40:53.205Z","dependency_job_id":null,"html_url":"https://github.com/vblinden/open-in-browser","commit_stats":null,"previous_names":["vblinden/open-in-browser"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vblinden/open-in-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vblinden%2Fopen-in-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vblinden%2Fopen-in-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vblinden%2Fopen-in-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vblinden%2Fopen-in-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vblinden","download_url":"https://codeload.github.com/vblinden/open-in-browser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vblinden%2Fopen-in-browser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017980,"owners_count":26086209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","vscode","vscode-extension"],"created_at":"2025-08-18T23:01:32.415Z","updated_at":"2025-10-14T04:08:25.101Z","avatar_url":"https://github.com/vblinden.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e This extension is entirely made by a combination of AI models.\n\n# Open in Browser\n\nA VS Code and Cursor extension that allows you to open files or selected code lines from your Git repository directly in the browser. Supports GitHub, GitLab, Bitbucket, Azure DevOps, and custom Git providers.\n\n## Features\n\n- **Open File in Browser**: Open the current file in your Git repository's web interface\n- **Open Selection in Browser**: Open specific lines of code in the browser (supports line ranges)\n- **Multiple Git Provider Support**: Works with GitHub, GitLab, Bitbucket, Azure DevOps\n- **Custom Provider Configuration**: Add support for private Git instances or custom providers\n- **Context Menu Integration**: Right-click context menu options for easy access\n- **Smart Line Detection**: Automatically detects selected lines or current cursor position\n- **Cursor Support**: Works seamlessly in the Cursor IDE with the same commands and menus\n\n## Usage\n\n### Context Menu\n\n1. **For Files**: Right-click in the editor or on a file in the Explorer → \"Git: Open In Browser\"\n2. **For Selections**: Select text in the editor → Right-click → \"Git: Open Selection In Browser\"\n\n### Command Palette\n\n- `Git: Open In Browser` - Opens the current file\n- `Git: Open Selection In Browser` - Opens the selected lines\n\n### Cursor Compatibility\n\nThis extension runs in Cursor out of the box. Use the same Command Palette entries and editor/explorer context menus as in VS Code—no extra setup is required.\n\n## Supported Git Providers\n\n### Built-in Support\n- **GitHub** (`github.com`)\n- **GitLab** (`gitlab.com`)\n- **Bitbucket** (`bitbucket.org`)\n- **Azure DevOps** (`dev.azure.com`)\n\n### Custom Providers\n\nYou can add support for private Git instances or other providers through VS Code settings.\n\n## Configuration\n\n### Settings\n\nAdd these settings to your VS Code settings.json:\n\n```json\n{\n  \"openInBrowser.defaultBranch\": \"main\",\n  \"openInBrowser.customProviders\": [\n    {\n      \"name\": \"My Private GitLab\",\n      \"domain\": \"gitlab.mycompany.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n    },\n    {\n      \"name\": \"My Private GitHub Enterprise\",\n      \"domain\": \"github.mycompany.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/blob/{branch}/{filePath}#L{startLine}-L{endLine}\"\n    }\n  ]\n}\n```\n\n### URL Template Placeholders\n\nWhen configuring custom providers, you can use these placeholders in your `urlTemplate`:\n\n- `{domain}` - Git provider domain (e.g., github.com)\n- `{owner}` - Repository owner/organization\n- `{repo}` - Repository name\n- `{branch}` - Current git branch\n- `{filePath}` - Relative file path from repository root\n- `{startLine}` - Starting line number\n- `{endLine}` - Ending line number\n\n### Configuration Options\n\n- **`openInBrowser.defaultBranch`** (string, default: \"main\"): Default branch name to use when current branch detection fails\n- **`openInBrowser.customProviders`** (array): Array of custom Git provider configurations\n\n## Examples\n\n### Opening a File\n1. Open any file in your Git repository\n2. Right-click → \"Git: Open In Browser\"\n3. File opens in your browser at the current branch\n\n### Opening Specific Lines\n1. Select text in your editor (or just place cursor on a line)\n2. Right-click → \"Git: Open Selection In Browser\"\n3. Browser opens showing the exact lines with highlighting\n\n### Custom Provider Example\n\nFor a private GitLab instance at `git.mycompany.com`:\n\n```json\n{\n  \"openInBrowser.customProviders\": [\n    {\n      \"name\": \"Company GitLab\",\n      \"domain\": \"git.mycompany.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n    }\n  ]\n}\n```\n\n## Requirements\n\n- VS Code 1.83.0 or higher, or Cursor (based on a compatible VS Code version)\n- Git repository with remote origin configured\n- Active internet connection to access Git provider web interface\n\n## Supported Git URL Formats\n\nThe extension supports various Git remote URL formats including complex repository structures:\n\n### Standard Formats\n- **HTTPS**: `https://github.com/owner/repo.git`\n- **SSH**: `git@github.com:owner/repo.git`\n- **SSH with protocol**: `ssh://git@github.com/owner/repo.git`\n\n### Complex Repository Structures\n- **GitLab Groups/Subgroups**: `git@gitlab.company.com:group/subgroup/repo.git`\n- **Multi-level paths**: `https://gitlab.company.com/group/subgroup/project.git`\n\nThe extension automatically handles GitLab group and subgroup structures, making it work seamlessly with enterprise GitLab instances that use complex repository hierarchies.\n\n## Quick Start Guide\n\n### For Standard Git Providers (GitHub, GitLab.com, etc.)\n1. Install the extension\n2. Open any file in your Git repository\n3. Right-click → \"Git: Open In Browser\"\n4. Done! The file opens in your browser\n\n### For Private Git Instances\n1. Add custom provider configuration to VS Code settings\n2. Use the extension normally\n\n**Example for private GitLab instance:**\n```json\n{\n  \"openInBrowser.customProviders\": [\n    {\n      \"name\": \"Company GitLab\",\n      \"domain\": \"gitlab.company.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n    }\n  ]\n}\n```\n\n## Common Use Cases\n\n### 1. Share Code Links\n- Select code lines → Right-click → \"Git: Open Selection In Browser\"\n- Copy the URL from browser to share with colleagues\n\n### 2. View File History\n- Open file in browser to access Git history, blame view, etc.\n\n### 3. Code Reviews\n- Quickly jump from local development to web interface for creating pull/merge requests\n\n## URL Templates for Popular Git Providers\n\n### GitHub Enterprise\n```json\n{\n  \"name\": \"GitHub Enterprise\",\n  \"domain\": \"github.company.com\",\n  \"urlTemplate\": \"https://{domain}/{owner}/{repo}/blob/{branch}/{filePath}#L{startLine}-L{endLine}\"\n}\n```\n\n### GitLab Self-Hosted\n```json\n{\n  \"name\": \"Company GitLab\",\n  \"domain\": \"gitlab.company.com\",\n  \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n}\n```\n\n### Gitea\n```json\n{\n  \"name\": \"Company Gitea\",\n  \"domain\": \"git.company.com\",\n  \"urlTemplate\": \"https://{domain}/{owner}/{repo}/src/branch/{branch}/{filePath}#L{startLine}-L{endLine}\"\n}\n```\n\n### Bitbucket Server\n```json\n{\n  \"name\": \"Bitbucket Server\",\n  \"domain\": \"bitbucket.company.com\",\n  \"urlTemplate\": \"https://{domain}/projects/{owner}/repos/{repo}/browse/{filePath}?at={branch}#L{startLine}-{endLine}\"\n}\n```\n\n## Troubleshooting\n\n### \"Not a git repository\" Error\n- **Solution**: Ensure your workspace is a Git repository\n- **Check**: Run `git status` in your terminal to verify\n- **Verify**: Confirm you have a remote origin with `git remote -v`\n\n### \"Unsupported Git provider\" Error\n- **Solution**: Add a custom provider configuration for your Git hosting service\n- **Check**: Verify the domain in your Git remote URL matches a configured provider\n- **Example**: If your remote is `git@gitlab.company.com:...`, add a provider with `\"domain\": \"gitlab.company.com\"`\n\n### Wrong Branch Opens\n- **Cause**: The extension uses your current Git branch\n- **Solution**: Switch to the correct branch with `git checkout \u003cbranch-name\u003e`\n- **Fallback**: If branch detection fails, it uses the configured default branch\n- **Configure**: Change default branch in settings: `\"openInBrowser.defaultBranch\": \"develop\"`\n\n### Line Numbers Don't Match\n- **Cause**: Different line endings or file versions between local and remote\n- **Solution**: Ensure your local changes are committed and pushed to the remote repository\n\n### Complex GitLab URLs (Groups/Subgroups)\n- **Supported**: The extension now handles complex GitLab structures like `group/subgroup/repo`\n- **Example**: `git@gitlab.company.com:frontend-team/web-apps/customer-portal.git` works automatically\n- **No Setup Required**: Just add the domain to your custom providers\n\n## Advanced Configuration\n\n### Multiple Custom Providers\nYou can configure multiple custom Git providers:\n\n```json\n{\n  \"openInBrowser.customProviders\": [\n    {\n      \"name\": \"Internal GitLab\",\n      \"domain\": \"gitlab.internal.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n    },\n    {\n      \"name\": \"Client GitLab\",\n      \"domain\": \"gitlab.client.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n    },\n    {\n      \"name\": \"GitHub Enterprise\",\n      \"domain\": \"github.company.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/blob/{branch}/{filePath}#L{startLine}-L{endLine}\"\n    }\n  ]\n}\n```\n\n### Workspace-Specific Settings\nAdd settings to `.vscode/settings.json` in your project root for team-wide configuration:\n\n```json\n{\n  \"openInBrowser.customProviders\": [\n    {\n      \"name\": \"Project GitLab\",\n      \"domain\": \"gitlab.project.com\",\n      \"urlTemplate\": \"https://{domain}/{owner}/{repo}/-/blob/{branch}/{filePath}#L{startLine}-{endLine}\"\n    }\n  ]\n}\n```\n\n## Contributing\n\nIssues and pull requests are welcome! Please visit the [GitHub repository](https://github.com/vblinden/open-in-browser) to contribute.\n\n## License\n\nThis extension is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvblinden%2Fopen-in-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvblinden%2Fopen-in-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvblinden%2Fopen-in-browser/lists"}